Ok, we have managed to make the camera track to the tilt direction. There is a little problem: the tilt bounces a bit, not something very significal. Here is our Tilt_Move code:
Code:
if(centroid_y<120-8) //there is a "-8" for making the range larger, avoids bounces
{
Tilt_Rotation=Tilt_Rotation+1; //sets to rotate by 1
SetPWM(Tilt_Servo_Port,Tilt_Rotation); //rotates
wait(10); //gives time for the servo to spin
}
else if(centroid_y>120+8)
{
Tilt_Rotation=Tilt_Rotation-1;
SetPWM(Tilt_Servo_Port,Tilt_Rotation);
wait(10);
}
What do you think about it?
