Coding Pneumatics

Hi, I am a member of a Robotics team trying to use pneumatic but my code isn’t working. When I click the button I coded nothing happens. If you have an answer that uses block code my team and I would appreciate it.

Have you tried testing the pneumatics using the devices menu?

1 Like

Along with EcstaticPilot’s advice could you post your block code? This would allow us to help you find the error. Without your code it’s a lot harder to debug the code. Also it is definitely possible the pneumatics aren’t wired/set-up correctly whether that be in code or externally.

1 Like

Here is the code


Here is how we set up the pneumatics

i think your problem is that both lines of code set solenoid to low, one of them should set it to high

1 Like

That didn’t change anything because after changing the code when I click the buttons on the controller nothing happened

did you fill the pneumatics with air…?

1 Like

yes we did fill it with air

You have a pressure regulator on there. The black/blue thing between the solenoid and the manual switch is a pressure regulator which might be unnecessary. Plus if you don’t set it up right it will stop all air flow. Try taking that out and then test the code again. Connect the solenoid directly to the air reservoir.

After some testing we figured out if we use the devices tab the pneumatic worked but when we try to use code it doesn’t work so anyone have a different way to code it with block code

Tell me if I’m wrong here but don’t you need the “if” statements in a forever block so it’s always checking it.


yeah with the current code the robot only checks to see if the button was pressed once, then stops.

try putting the if statement in a forever loop, so the robot is constantly checking to see if the controller button is pressed.

1 Like

Thank you for the help that solved our problem. We really appreciate your help giving us the chance to move on with our robot.

1 Like