Code:
if (p1_sw_top ==1)
{
pwm01=200;
}
That should work. Make sure nothing else is controlling pwm01 later, and that your motor is actually connected to a Victor on pwm01. If the Victor's light is flashing, there's a problem with the pwm cable. You can plug a servo directly onto the pwm pins to make sure the signal is getting out of the RC. Also, use the Dashboard program to make sure the top joystick button is being recognized by the OI.
Code:
//Somewhere in the top of the file
int output =0;
//Down in the file
output = p1_sw_top;
if (output = 1)
{
pwm01=200;
}
This will
not work the way you intend, because you used a single equals sign in your
if statement. That sets output to 1 every time, pwm01 will always be set to 200.