Skip to content

Commit

Permalink
[raspi]PanTiltHatのdemo
Browse files Browse the repository at this point in the history
  • Loading branch information
lm-itou committed Oct 30, 2019
1 parent 00f6e3c commit 206bd7d
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions raspi/12-pimoronis/pantilthat01.py
Original file line number Diff line number Diff line change
@@ -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')

0 comments on commit 206bd7d

Please sign in to comment.