A simple demo of programming a pan-tilt servo rig to move a camera to put the center of the image at the centroid of a color object.
The purpose of this project was not entirely to create a face-follower, but rather to create it by having AI do most of the programming. Both the Arduino and Host Python programs were almost entirely generated with a conversation with ChatGPT.
The servo
program runs on an Arduino that is connected to an I2C 16 port
servo driver. ( A4 -> SDA, A5->SDL)
- Load the
servo
program onto an Arduino - Edit
follow.py
to reference the serial device of the Arduino.
Once it is running, the pan-tilt should hunt around to find a red object.
( Click to watch )
A view from the camera, showing the object bounding box and centroid.
A view of the Pan-tilt device.