Does anyone know how to code pneumatics in Visual Studios?

Hi! My team is trying to prepare for next year’s competition. We found that Visual Studios works better for us, so we are trying to learn as much as we can about it so that we can be more prepared for next year’s competition. I have tried many different codes for the pneumatics and none of them have been successful. Any help or ideas is greatly appreciated. Thank you!!

1 Like

Hello! In C++, pneumatics are defined as a digital-out device.

Ex:

digital_out mogoMech = digital_out(ThreeWirePort.A);

To push/retract the pneumatic piston, you can use the ‘set’ function.

mogoMech.set(true);

Hope this helps!

This did not work. Thank you for trying!!<3

I found a code that worked.

def onevent_controller_1buttonUp_pressed_0():
global myVariable, vexcode_brain_precision, vexcode_console_precision, vexcode_controller_1_precision
digital_out_a.set(False)

def onevent_controller_1buttonDown_pressed_0():
global myVariable, vexcode_brain_precision, vexcode_console_precision, vexcode_controller_1_precision
digital_out_a.set(True)

In case anyone wanted to know this is the code that I used.