Raspi 3B with pan tilt hat and LED

The code below is code I used to find presets for Motion Eye. As posted it will center the two servo’s and do a preview of what the camera is looking at. Changing the values in
pantilthat.pan(0)
and
pantilthat.tilt(0)
will change where the servo’s move too. It goes from -90 to +90.
That video you linked to is using PWM directly from the Pi’s GPIO pins to control the servos. Its not going to work with the Pan Tilt Hat.

My pan tilts are setup to work via Action Buttons in the Motion Eye OS web interface. My camera runs headless and I access it via a Web Browser. The Web GUI has all the controls to take pictures or record video. Manually or by detecting motion in front of the camera. I added left right up down movement buttons and some preset positions. You can also add buttons to turn the LED’s on and off.

from picamera import PiCamera
from time import sleep
import pantilthat


pantilthat.pan(0)
pantilthat.tilt(0)




camera = PiCamera()
camera.rotation = 180
camera.resolution = (1280, 720)

camera.start_preview()
sleep(10)
camera.stop_preview()