Created
November 9, 2016 19:05
-
-
Save lesp/72f142240764589c2390b07a51a7071a to your computer and use it in GitHub Desktop.
Old version of the code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import os | |
import RPi.GPIO as GPIO | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(23 , GPIO.IN) | |
while True: | |
counter = 0 | |
if GPIO.input(23)==1: | |
while counter < 21: | |
counter = counter + 1 | |
os.system('raspistill -o '+(counter)+'.jpg') | |
os.system(‘gpicview image.jpg &’) | |
sleep(20) | |
os.system(‘killall gpicview’) | |
else: | |
print "Ready to take picture" | |
GPIO.cleanup() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment