diff options
author | xengineering <mail2xengineering@protonmail.com> | 2021-06-17 09:00:07 +0200 |
---|---|---|
committer | xengineering <mail2xengineering@protonmail.com> | 2021-06-17 11:27:05 +0200 |
commit | 52972b810a9a42cef5c88f9947d64a0705f243ac (patch) | |
tree | 6ce0307a030bb5279a695506868a424f6ab6599c /python | |
parent | 591097e5a3741432e2acd9c41fadd4eb10678674 (diff) | |
download | birdscan-52972b810a9a42cef5c88f9947d64a0705f243ac.tar birdscan-52972b810a9a42cef5c88f9947d64a0705f243ac.tar.zst birdscan-52972b810a9a42cef5c88f9947d64a0705f243ac.zip |
Implement single Picture Mode
Diffstat (limited to 'python')
-rw-r--r-- | python/birdscan/__main__.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/python/birdscan/__main__.py b/python/birdscan/__main__.py index a25dee2..77fae73 100644 --- a/python/birdscan/__main__.py +++ b/python/birdscan/__main__.py @@ -8,15 +8,27 @@ This is the main executable of the birdscan package. """ +import sys import time def main(): """Main function of this module""" - while True: - print("Active!") + if len(sys.argv) == 2: # check if argument is given (--debug) time.sleep(1) + sys.stdout.write("ok") + else: + from picamera import PiCamera + camera = PiCamera() + camera.resolution = "3280x2464" + camera.start_preview() + # Camera warm-up time + time.sleep(2) + camera.capture("/var/lib/birdscan/{}.jpg".format( + time.strftime("%Y-%m-%d_%H-%M-%S", time.localtime())) + ) + sys.stdout.write("ok") if __name__ == "__main__": |