Skip to content

Instantly share code, notes, and snippets.

@lesp
Created November 9, 2016 19:05
Show Gist options
  • Save lesp/72f142240764589c2390b07a51a7071a to your computer and use it in GitHub Desktop.
Save lesp/72f142240764589c2390b07a51a7071a to your computer and use it in GitHub Desktop.
Old version of the code
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 &amp;’)
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