I want it to take multiple photos, all starting with the datetime-string. But it only takes one photo!?
I get the same when running the take_photo() function in a while loop.
Probably basics...but can anyone give give me some advice?
Code: Select all
from picamera import PiCamera import time import datetime as dt import sys camera = PiCamera() camera.resolution=(720, 300) i = dt.datetime.now() now = i.strftime('%Y%m%d-%H%M%S') filepath = now + ".jpg" def take_photo(): print("Taking a photo...") camera.capture(filepath) time.sleep(1) for i in range(10): time.sleep(1) take_photo()