View Single Post
  #5   Spotlight this post!  
Unread 06-02-2007, 06:55
itsme itsme is offline
Registered User
FRC #2217 (FOMH)
Team Role: Programmer
 
Join Date: Dec 2006
Rookie Year: 2007
Location: Israel
Posts: 86
itsme is an unknown quantity at this point
Re: Desperate for help in camera tracking

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?