Quote:
Originally Posted by Choi9111
ya duh i know that...i was talking more about programming wise... thanks for making me seem dumb.
|
Then the answer is still yes. If the inputs are to sensitive, then you should scale them. For example, if you desire more control over the lower 1/3 of the throttle, just write a function that scales the input so the lower 1/3 of the output to the PWM is spread over a larger fraction of the joystick movement.
lets say you want more control over the output range 127-168. Scale the input by dividing the actual joystick value by a constant greater than 1 or multiply the joy value by a constant less than 1. You will need a conditional to evaluate if the joystick is <=168 in this example. If the condition is true you would apply the scaling to the input value.
#define SCALING_FACTOR .8
If (joy <= 168 && > 0)
{
unsinged char pwm;
pwm = scale(joy);
}
unsigned char scale(unsigned char joy_val)
{
new_pwm = joy_val * SCALING_FACTOR;
return new_pwm;
}
Now this does not account for the reverse values but you get the idea. This is just an example and probably wont work.
__________________
Mike Copioli
CTRE Hardware Engineer
http://www.ctr-electronics.com
Team 3539 The Byting Bull Dogs
2013 Michigan State Champions
Team 217 The Thunder Chickens
2006 World Champions
2008 World Champions
2009 Michigan State Champions