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.
Thanks!
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.
If btn8l
Piston1 = 1
Else
Piston1 = 0
If btn8r
Piston2 = 1
Else
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.
Same as the other code, looks fine, try it and watch the debug values for the pneumatics. If they’re switching as they should in the debug but not on the robot, you know there’s a physical problem