Quote:
|
Originally Posted by tux
Code:
if (rstick.GetRawButton(1)){
armUp.Set(false);
armDn.Set(true);
} else if (rstick.GetRawButton(2)){
armUp.Set(true);
armDn.Set(false);
}
if (rstick.GetRawButton(10)){
miniOut.Set(true);
miniIn.Set(false);
} else if (rstick.GetRawButton(7)){
miniOut.Set(false);
miniIn.Set(true);
}
|
I would strongly recommend you add the following cases:
Code:
if (rstick.GetRawButton(1)){
armUp.Set(false);
armDn.Set(true);
} else if (rstick.GetRawButton(2)){
armUp.Set(true);
armDn.Set(false);
} else {
armUp.Set(false);
armDown.Set(false);
}
if (rstick.GetRawButton(10)){
miniOut.Set(true);
miniIn.Set(false);
} else if (rstick.GetRawButton(7)){
miniOut.Set(false);
miniIn.Set(true);
} else {
miniOut.Set(false);
miniIn.Set(false);
}
As you have it at the moment, if you press, say, button 10 on the joystick, the miniOut solenoid will activate, but will not turn off if you release the button. That's probably not what you would want it to do.