View Single Post
  #3   Spotlight this post!  
Unread 29-03-2005, 21:59
devicenull devicenull is offline
Robot? We need a robot?
no team
 
Join Date: Sep 2004
Rookie Year: 1234
Location: n/a
Posts: 359
devicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nicedevicenull is just really nice
Re: Autocalibrate function

I did it slightly differnt.

I read the joystick value at all times. If its greater then the max, or smaller then the lowest, I set either the high/low to the new value, update it in eeprom, and set the new center to (high+low)/2, after that, joystick deadbands are achieved by dividing (high-low) by 30.

I just looked through my code, and realized that I never actually used the center point. Weird, I should probably fix that.