Add servo control for 3rd camera panning
felipe-m opened this issue · comments
Felipe Machado commented
The third camera would be mounted on a turret controlled by a servo.
The servo can move from 0 to 180 degrees, but we will say that it moves from -90 degrees to 0 degrees and to +90 degrees.
The servo is controlled by the SPI control, and receives a 10-bit signed signal. Being:
-500 -> -90 degrees
0 -> 0 degrees
+500 -> 90 degrees
The control module receives a 8-bit centroid signal
7654 3210 :bit number (but the right-left orientation is backwards)
----------
0001 1000 : centered
0001 0000 : slightly to the right
0010 0000 : to the right
0100 0000 : more to the right
1000 0000 : to the right most
0000 1000 : slightly to the left
0000 0100 : to the left
0000 0010 : more to the left
0000 0001 : to the left most
And it should command the servo depending on where the object is detected