View Single Post
  #8   Spotlight this post!  
Unread 22-02-2004, 19:37
mightywombat's Avatar
mightywombat mightywombat is offline
bins? stacking?? NOOOOO!
AKA: Bill Rosemurgy
#0857 (Superior Roboworks)
Team Role: Programmer
 
Join Date: Dec 2003
Location: Houghton, MI
Posts: 93
mightywombat is on a distinguished road
Re: Neutral for joysticks isn't 127

i have found that this years joysticks really don't have that wonderful of a center position. we are using sticks from previous years.... other than the trim tabs being off you may need to do some scaling. what we do is this

#define left_MAX 254
#defing left_MIN 16

pwm01 = ((pwm01 - left_MIN) * 256) / (left_MAX-left_MIN);

this is the basic way we do it. i don't have the code with me but i know we break up the equation so we don't lose as much in the dividing so that the dividing is easier on the proc.
__________________
Bill Rosemurgy - Aspiring Programmer and Human Player (stack of 8 in <10 seconds...oh yeah... but I can't shoot for crap.)
www.team857.com