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.
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;
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.
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?
vex::digital_out solenoid(Brain.ThreeWirePort.A); solenoid.set(true);
Last I used pneumatics this worked.
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.
The latest version of VEXcode V5 includes “Digital In” and “Digital Out” 3-wire device options to support the use of solenoids.
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.