Skip to content

Instantly share code, notes, and snippets.

@jamosaur
Created March 4, 2014 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamosaur/9343988 to your computer and use it in GitHub Desktop.
Save jamosaur/9343988 to your computer and use it in GitHub Desktop.
Raspi timelapse
import os
# Starting number.
fileNumber = 1
while True:
# Set a file number (00000000)
fileNumberSave = "%08d" % (fileNumber)
imgWidth = 1280
imgHeight = 720
# Save file to the timelapse DIR
os.system("raspistill -w " + str(imgWidth) + " -h " + str(imgHeight) + " -o /timelapse/" + str(fileNumberSave) + ".jpg -sh 40 -awb auto -mm average -v")
# Save one to the web dir...
os.system("raspistill -w " + str(imgWidth) + " -h " + str(imgHeight) + " -o /var/www/cam.jpg -sh 40 -awb auto -mm average -v")
# add one to the file number
fileNumber += 1
# Wait x seconds until taking another photo
time.sleep(10)
else:
# Do Nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment