|
Re: Syntax Error!
The math.h trig functions only take radians.
If you want, you can do a macro to do degrees, i.e.:
#define PI 3.14159265f
#define dtan(x) tan(x*PI/180.0f)
Then, put this in your code where appropriate:
dtan(tilt_angle_rad);
The only thing that I can think of that would make your equation give bogus results is if the servo angle conversion function is off. Make sure that whatever Kevin's code defines as the servo's zero corresponds with 0 degrees of tilt - you may have to either rotate the servo horn or redefine the zero point (in tracking.h) to find a good zero.
|