Log in

View Full Version : Programming help go foward but not reverse


Tds123
29-01-2010, 12:26
Here is my robots code...

http://paste.pocoo.org/show/171676/

The spike that run " winch"
and the spike runs "roller" the button that makes it go foward works but the buttons that make it go in reverse dont work...please help with this someone!!!

and the jaguar for arm... when both buttons are pressed the jaguar turns green one of them is supposed to be red for reverse...

byteit101
29-01-2010, 16:56
you are turning it off
if (armjoy.GetRawButton(outtakeButton) == 1) {
roller.SetDirection(Relay::kForwardOnly);
roller.Set(Relay::kOn);
} else if (armjoy.GetRawButton(intakeButton) == 1) {
roller.SetDirection(Relay::kReverseOnly);
roller.Set(Relay::kOn);//not kOff
} else {
roller.Set(Relay::kOff);
}

if (armjoy.GetTrigger() == 1) {
winch.SetDirection(Relay::kForwardOnly);
winch.Set(Relay::kOn);
} else if (armjoy.GetRawButton(winchDownButton) == 1) {
winch.SetDirection(Relay::kReverseOnly);
winch.Set(Relay::kOn);//not kOff
} else {
winch.Set(Relay::kOff);
}