Quote:
Originally Posted by itsme
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? 
|
That's just about exactly what I was hoping you'd do! Good job!
Is it slow at all? It seems like moving it by 1/255 of the servo's range would be somewhat slow. Maybe not. Don't listen to me if it's working...
Let me know if you need more help.
JBot