|
Re: Button programin C++
If your joystick's name in the program is "hand" then the portion of the code that needs to be the argument for the if statement is as follows: "hang.GetTrigger()".
The code segment would look like
if ( !hand.GetTrigger()){
motors.Set(x);
}
else{
motors.Set(x/2);
}
You don't need a boolean variable for this code, only the value coming directly from the joystick.
|