3D Printed Raspberry Pi Pan-Tilt Camera Brackets
Previously we looked at running servos on our Raspberry Pi. What can we do with that?
Well, how about controlling a camera?
With this "pan and tilt" set up, you can direct the lens left and right, and up and down :)
Grab the STL files here at Thingiverse
Hooking Up
Ground: Black/Brown
Power: Red/Orange
Signal: White/Yellow
I am using pins 17 and 27 on the Pi for signal
Code
Same deal as before
Run sudo pigpiod then the following Python:
from time import sleep
import pigpio
pi = pigpio.pi()
while True:
pi.set_servo_pulsewidth(17, 0) # off
pi.set_servo_pulsewidth(27, 0) # off
sleep(1)
pi.set_servo_pulsewidth(17, 1400) # start
pi.set_servo_pulsewidth(27, 1400) #
sleep(1)
pi.set_servo_pulsewidth(17, 1500) # middle
pi.set_servo_pulsewidth(27, 1500) #
sleep(1)
pi.set_servo_pulsewidth(17, 1600) # end
pi.set_servo_pulsewidth(27, 1600) #
sleep(1)
