View Single Post
  #3   Spotlight this post!  
Unread 08-02-2006, 23:41
sparkydp sparkydp is offline
Registered User
AKA: David Page
FRC #0435 (Robodogs)
Team Role: Mentor
 
Join Date: Apr 2005
Rookie Year: 2002
Location: Raleigh, NC
Posts: 32
sparkydp is on a distinguished road
Re: Grabbing Tilt Angle?

if you're using the Kevin Watson code that places the tilt servo on PWM1, you can simply read the value of pwm01, but it has also been #defined as PAN_SERVO for more intuitive readings. In the file tracking.c, you'll see a section of the code that starts with a comment "// y-axis/tilt tracking code"
you can see how the tracking.c uses it.

But at any rate, it won't really give you an angle, so much as the position of the servo which is a number between 0 and 255, looking that up to an angle is either some scary math which might not be consistent with anyone else's based on how you installed the servo horns onto the servos. I would recommend just echoing your tilt value to the console with a printf and moving the camera until you determine what PWM value represents the angle you want.