Skip to content

Instantly share code, notes, and snippets.

@frankmeeuwsen
Created February 6, 2021 21:52
Show Gist options
  • Save frankmeeuwsen/4d969d7a0e8aa605c174fac57b55eb3e to your computer and use it in GitHub Desktop.
Save frankmeeuwsen/4d969d7a0e8aa605c174fac57b55eb3e to your computer and use it in GitHub Desktop.
Timelapse for the Raspberry Pi with PiCam
from time import sleep
import picamera
from fractions import Fraction
WAIT_TIME = 60
with picamera.PiCamera() as camera:
camera.framerate = Fraction(1, 6)
camera.shutter_speed = 6000000
camera.iso = 800
camera.exposure_mode = 'night'
camera.resolution = (1024, 768)
for filename in camera.capture_continuous('/home/pi/time-lapse/img{timestamp:%H-%M-%S-%f}.jpg'):
sleep(WAIT_TIME)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment