Java Pneumatics

Hi, I am with team 6871 and we are currently having a problem with our code. We were wondering if someone can look over it and tell us what we are doing wrong with our pneumatic system.https://drive.google.com/open?id=1vFgRWWW6PwY7z9tbBnTdH_DiKgGYGagG

I’m not entirely sure that this is your issue, but it might help to use some if else statements instead of a couple of I statements. Try to make sure that the solenoid only receives one instruction per loop, rather than the conflicting instructions that it could be receiving now.

Edit: I realized this wasn’t very clear. With the default instructions outside of the if statements, they are called even when the buttons are pressed, creating conflicting instructions for one of the solenoids each time. Similarly, pressing both buttons at a time would have three instructions sent to each solenoid.

Your code, from what I can tell, should work. Would you be able to get a picture of the top part of the code? One problem could be that the ports you told the code the solenoids are plugged into aren’t actually the ports the solenoids are plugged into. Also, what is the voltage for the solenoids? The PCM (pneumatic control module) could be set to output the wrong voltage. You can see the voltage the PCM is currently outputting by checking the bridge connector location in the PCM. I don’t know where to check on the solenoid to find what the input voltage needs to be. I do agree with the user that said to use if-else statements to make sure the code isn’t conflicting with itself. Is the compressor turning on? If not, either it isn’t plugged in correctly or for some reason the code isn’t running the command that tells it to turn on, which would mean it’s also skipping over the part of the code to tell the solenoids to change state.