Because you have two separate if...else statements, if the reverse button isn't held down, the output will be zero regardless of the forward button's state.
Also, this:
has no code to execute because of that trailing semicolon. An "if" will execute the statement immediately after it up until a semicolon, or if you put the code inside {curly braces}, it will execute everything in the first set of braces. If statements don't need any additional semicolons.
A quick rewrite yields this:
Code:
if(leftjoystick->GetRawButton(1))
{
jaguar->Set(1.0);
}
else if (leftjoystick->GetRawButton(2)) {
jaguar->Set(-1.0);
} else {
jaguar->Set(0.0);
}
That will work.
Alan Anderson let me know that I messed up. I misread your code snippet: I didn't realize that the reverse button would drive the motor in reverse... (crosses eyes) I really need some more sleep.
Let me know if you have any more questions or problems.
Jacob