View Single Post
  #8   Spotlight this post!  
Unread 07-02-2007, 00:15
Uberbots's Avatar
Uberbots Uberbots is offline
Mad Programmer
AKA: Billy Sisson
FRC #1124 (ÜberBots)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Avon
Posts: 739
Uberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond repute
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