View Single Post
  #22   Spotlight this post!  
Unread 02-02-2004, 21:53
MichalSkiba MichalSkiba is offline
Low-Power BiCMOS Brain
#0854 (M.I.R.)
 
Join Date: Apr 2003
Location: TORONTO
Posts: 64
MichalSkiba will become famous soon enough
Re: Desensitizing Joysticks

This is what I came up with during our team's meeting today after school:

/*
pwm is a jostick value, 0-254
pwm_in is the pwm_out of the default code
pwm_out is the new value going to the joysticks
null_zone_swing_fraction is the amount you'd want the joystick to move without the motors kicking in.
*/

pwm_out = (pwm_in / (1-null_zone_swing_fraction)) - null_zone_swing_fraction(1 - null_zone_swing_fraction)

So. Its quite simply a y = mx + b "transfer" function. enjoy.
__________________
<<<theoldmanskiba>>>

2003 Canadian Regional Delphi Driving Tomorrow's Technology Award winners