Last active
November 9, 2016 16:51
-
-
Save lesp/984f6c8284390812849400d9e353846a to your computer and use it in GitHub Desktop.
Take 20 pics using Picamera
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
from gpiozero import Button | |
from picamera import PiCamera | |
from datetime import datetime | |
from signal import pause | |
button = Button(18, pull_up=False) | |
camera = PiCamera() | |
def capture(): | |
datetime = datetime.now().isoformat() | |
camera.capture('/home/pi/%s.jpg' % datetime) | |
print("Ready to take picture") | |
for i in range(20): | |
button.when_pressed = capture | |
pause() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment