View Single Post
  #11   Spotlight this post!  
Unread 24-01-2007, 14:35
Mike Copioli's Avatar
Mike Copioli Mike Copioli is offline
You make it pretty We make it dance
no team (Retired(3539, 217))
Team Role: Engineer
 
Join Date: Jan 2006
Rookie Year: 2001
Location: Romeo
Posts: 453
Mike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond reputeMike Copioli has a reputation beyond repute
Re: How the heck do you use an XBOX360 controller with the chicklet??

Quote:
Originally Posted by Choi9111 View Post
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

Last edited by Mike Copioli : 24-01-2007 at 21:30.
Reply With Quote