|
Re: Bizarre Driving Issue
you are overflowing, i can guarantee it. The type of the variable is an unsigned char, and none of the numbers are larger than that range within the calculation. Therefore, your values overflow when you multiply by that huge number.
Typecast "p2_x" and whatnot into signed ints, and this should rectify that issue.
(note that you could also use encoders which are much more accurate and friendly)
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY
|