View Single Post
  #5   Spotlight this post!  
Unread 26-02-2007, 00:17
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Trouble with Autonomous

The other problem I see is your putting parentheses around your SPEED_TO_PWM macro. With them there, you have a similar rounding issue, and the 127/10 ends up being truncated to 12. If you leave the paretheses off but everything else as it is, the division by 10 won't happen until after all the multiplications are done and you'll end up with more like what you want.