One bug in your code, byteit101
Quote:
Originally Posted by byteit101
Joystick stick3(3);//obviously
Jaguar jag1(3);//PWM port 3
bool btn3state=false;
if (stick3.GetRawButton(3))
{
if (!btn3state) //if the button has not been depressed
{
jag3.Set(0.5);
btn3state=true; //the button has been depressed
}
else
{
jag3.Set(0.0);
btn3state=false; //the button was clicked again
}
}
|
Otherwise, you'd click the button first to set the jag to 0, then the second click would set it to 0.5. Unless I missed something.