Hello, we need help with our pneumatic system. we are having s strange issue where one piston won’t fire, but we have tried every solution we could think of, but the cylinder won’t fire. We will attach our code, and will continue to test.
The code with the switches should be done differently. The below is so that while a button is pressed the cylinder is actuated, which is what your current code would do. If you want to do it so that if you tap the button it will fire for 100ms and then release let us know.
Sorry for pseudocode, on mobile.
Piston1 = 1
Piston1 = 0
Piston2 = 1
Piston2 = 0
Once you’ve done the code posted previously, monitor the debug windows of sensor values just to make sure they are changing as they should when buttons are held. If that’s the case, and the piston still isn’t working, you’ve isolated the problem to something physical. Swap out driver cables and solenoids if you have spares, or if not switch with the other solenoid to try to find the defective part. If you hold the solenoid up to your ear, you should be able to hear a clicking whenever it actuates.
It might seem obvious, but also check through all your tubing to make sure air is getting where it needs to, and that all manual valves are open. If you’re unsure of something, post a picture.
Yes, that looks fine. If you’re interested, I also shortened the code a bit above because if you only have one line of code after a switch or loop you don’t need brackets. Your code is functionally identical and will work the same though, it’s just a style thing.