View Single Post
  #28   Spotlight this post!  
Unread 20-01-2007, 14:01
arizonafoxx's Avatar
arizonafoxx arizonafoxx is offline
Registered User
FRC #4395 (T-Rex)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Fort Mill, SC
Posts: 96
arizonafoxx is an unknown quantity at this point
Re: *** CMUcam2 Frequently-Asked-Questions ***

When we tested the camera code it works perfectly. The camera will track the green light. We have our programming cable hooked up so that we get our Pan and Tilt angles displayed on the computer screen. Our question is what variable can we use from the code to take the Pan angle displayed on the computer and use it to change the position of the robot. We want to use a comparison statement like:

Psuedo Code
if(Pan_Angle > 10)
{
Turn robot left
}

if(Pan_Angle < -10)
{
Turn Robot right
}

if(Pan_Angle > -10 && Pan_Angle < 10)
{
Robot does not turn
}

We also want to do a similar thing with the tilt to calculate the distance. This is my first year with FRC but I am very familar with C programming and MPLab. I have looked through Kevin's code but I can't figure out what variable will acvhive our desired output. If anyone knows what i'm talking about please help me out.