Pneumatics not working vex code v5 blocks

Hello, I am trying to program pneumatics using vex code v5. I tried coding it under led 3 wire sensor as I saw other people doing this but it doesn’t seem to be working. Can someone help me? Thanks.

1 Like

Posting a screenshot of your code and robot configuration panel in VEXCode will help.

I have the code to my drive on another file, I was testing with the pneumatics on a separate one, I am new to the pneumatics so I only have a little bit of code. I watched a couple videos on how to plug the pneumatics in and whatnot, I believe it is either the code or the pneumatics not functioning. Here is the screenshot;Screenshot 2021-06-15 144507

1 Like

You should put that if statement in an infinite loop. I believe its a while true or repeat forever block.

Otherwise that statement is only evaluated once for a short amount of time when the program is started.

1 Like

Much more likely your problem lies within hardware. (check to see if the solenoid works (press the small blue button), connected to the relevant port on the brain, wires aren’t damaged, etc…). Can you show us an image of your setup?

2 Likes
vex::digital_out solenoid(Brain.ThreeWirePort.A);
solenoid.set(true); 

Last I used pneumatics this worked.

3 Likes

If you do want to actually test it i’d place a set true block on the led then wait 2 seconds, then set it to false.

See if anything happens, you should hear a feint click in the solenoid if you don’t have air in the system.

1 Like

The latest version of VEXcode V5 includes “Digital In” and “Digital Out” 3-wire device options to support the use of solenoids.

https://kb.vex.com/hc/en-us/articles/360059343891-Configuring-3-Wire-Digital-In-and-Digital-Out-Devices-in-VEXcode-V5

Screen Shot 2021-06-16 at 8.42.07 AM

3 Likes

Remember, essentially what you are trying to do is make current flow through the solenoid. By setting the port’s output to High (True or a binary 1) you allow that to happen.

1 Like