Created
April 4, 2021 12:50
-
-
Save tommylees112/70fa46fe463f0a8a89f5a2feda776053 to your computer and use it in GitHub Desktop.
Take camera image
This file contains hidden or 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
""" | |
append to bottom of `/home/pi/.bashrc` | |
nohup python3 /home/pi/REACH_tjx/scripts/run_camera.py | |
""" | |
from datetime import datetime | |
from time import sleep | |
from picamera import PiCamera | |
if __name__ == "__main__": | |
DELAY_IN_MINUTES = 1 | |
camera = PiCamera() | |
camera.resolution = (2592, 1944) | |
camera.framerate = 15 | |
while True: | |
dt = datetime.now() | |
dt_str = f"{dt.year:02}{dt.month:02}{dt.day:02}_{dt.hour:02}:{dt.minute:02}" | |
print(f"Taking Image: {dt_str}") | |
camera.start_preview() | |
camera.annotate_text = f"{dt_str}" | |
camera.stop_preview() | |
sleep(DELAY_IN_MINUTES * 60) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment