From 206bd7dd80e0c1c3aba2655371e48a8102b45c30 Mon Sep 17 00:00:00 2001 From: Yosei Ito Date: Wed, 30 Oct 2019 22:24:44 +0900 Subject: [PATCH] =?UTF-8?q?[raspi]PanTiltHat=E3=81=AEdemo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- raspi/12-pimoronis/pantilthat01.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 raspi/12-pimoronis/pantilthat01.py diff --git a/raspi/12-pimoronis/pantilthat01.py b/raspi/12-pimoronis/pantilthat01.py new file mode 100644 index 00000000..7988e7c0 --- /dev/null +++ b/raspi/12-pimoronis/pantilthat01.py @@ -0,0 +1,29 @@ +import picamera, time +import pantilthat as pt + +cam = picamera.PiCamera() +cam.hflip = True +cam.vflip = True + +pt.pan(0) +pt.tilt(0) +time.sleep(1) +pt.pan(-12) +time.sleep(1) +pt.tilt(12) +time.sleep(1) +pt.tilt(0) +time.sleep(1) +pt.pan(12) +time.sleep(1) +pt.tilt(12) +time.sleep(1) +pt.tilt(0) +time.sleep(1) +pt.pan(0) +time.sleep(1) + +cam.start_preview() +time.sleep(2) +cam.capture('test.jpg') +