Skip to content

Instantly share code, notes, and snippets.

@Azuxul
Created April 3, 2017 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Azuxul/ff1d1679edab442ef9589f87573ffa28 to your computer and use it in GitHub Desktop.
Save Azuxul/ff1d1679edab442ef9589f87573ffa28 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*-coding:Utf-8 -*
import time
from picamera import PiCamera
from datetime import datetime
"""Take picture every hour"""
__author__ = "Lancelot Herrbach (Azuxul)"
__email__ = "meow@azuxul.fr"
camera = PiCamera()
camera.resolution = (2592, 1944)
while True:
date = datetime.now()
timestamp = int(time.time())
if date.minute == 0 and date.second == 0:
camera.capture("/mnt/usbkey/%s.jpg" % timestamp)
time.sleep(0.2)
quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment