Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import time
- import picamera
- import RPi.GPIO as GPIO ## Import GPIO library
- GPIO.setmode(GPIO.BOARD) ## Use board pin numbering
- GPIO.setup(16, GPIO.OUT) ## Setup GPIO Pin 16, GPIO 23 to OUT
- GPIO.setup(18, GPIO.OUT) ## Setup GPIO Pin 18, GPIO 24 to OUT
- while True:
- with picamera.PiCamera() as camera:
- camera.hflip = True
- camera.vflip = True
- GPIO.output(16,True)
- GPIO.output(18,True)
- camera.start_preview()
- time.sleep(2)
- for filename in camera.capture_continuous('/home/pi/images/img{counter:05d}.jpg'):
- # print('Captured %s' % filename)
- GPIO.output(16,False)
- GPIO.output(18,False)
- time.sleep(299) # wait 5 minutes
- GPIO.output(16,True)
- GPIO.output(18,True)
- time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement