View Single Post
  #3   Spotlight this post!  
Unread 10-02-2007, 23:15
gnirts gnirts is offline
Suspicious pointer conversion
AKA: Robinson Levin
FRC #1648 (The Gearbox Gangstaz)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: ATL
Posts: 116
gnirts will become famous soon enough
Re: Servo Values to Degrees... How?

Quote:
Originally Posted by paulcd2000 View Post
but how can you convert tilt servo values into degrees. sorry, i'm kinda tired, so i might be being dense

EDIT: Would this work?
Code:
                angle= (TILT_SERVO-STOP)*0.75757575;
                distance = HEIGHT_DIFF/atan(angle);
.757575... is the degrees per servo step
I am pretty sure you want tan() and not atan()

Good luck,
Robinson