Log in

View Full Version : RobotBuilder toggle option?


bvisness
14-01-2014, 21:57
So I'm using RobotBuilder to generate code for a test robot and I want to toggle a command on and off with a joystick button. There is a method in the command-based code to do this (button->ToggleWhenPressed()) but no option in RobotBuilder. (See attached screenshot.)

Any idea why this is? Is there a way to enable this somehow?

DjScribbles
15-01-2014, 10:07
I believe you can simply select "When Pressed" and build the toggle into the command.

BradAMiller
15-01-2014, 10:28
So I'm using RobotBuilder to generate code for a test robot and I want to toggle a command on and off with a joystick button. There is a method in the command-based code to do this (button->ToggleWhenPressed()) but no option in RobotBuilder. (See attached screenshot.)

Any idea why this is? Is there a way to enable this somehow?

We might be able to get that enabled in RobotBuilder, but in the mean time, you can edit the whenPressed() method to be toggleWhenPressed() in the generated code. Just be sure to do it outside of the //BEGIN //END generated code comments.

bvisness
15-01-2014, 18:44
If you could work that into RobotBuilder I would be incredibly happy. In the meantime, that's exactly what I've done - moved it outside the comments and modified it. Thanks for your help!