|
Re: Victors Controlled By Joystick Buttons
if you want the victor to go full forward when the button is held down, then you can do something like:
pwm05 == the pwm channel the victor is connected to
p1_sw_trig == joystick button that activates victor
if (p1_sw_trig)
{
pwm05 = 254;
}
else
{
pwm05 = 127;
}
The if statement executes faster than a multiply or some other way of mapping.
You may also need to debounce the joystick button, but since you say you are connecting it to a victor and not a pneumatic of some kind it may not matter.
__________________
Joel Johnson
Division By Zero ( 229) Alumni, 2003-2007
RAGE ( 173) Alumni, 1999-2003
|