Pneumatic Piston Retracting Issue

I’m using PROS by Purdue to actuate a piston, but after each cycle of the loop the piston retracts, and I’m not sure why. How would I be able to keep it in the extended position? (The delay is there because without it the piston won’t actuate, due to it being retracted right after). (Also I tried to see if I did the same in VEXCode V5 but it worked correctly there) Here is my code, where I have the button to extend the piston:
if (wingButton.isPressed()) {

It’s pronounced cylinder :wink:


The piston is the object moving due to the compressed air in the cylinder, I want the piston to move back and forth not the cylinder, if the cylinder moved that would be bad


Finally. Someone said it.


Also thanks to Ben on the VEX Discord the issue was solved, the problem was that I initialized leftWing in the while true loop in opcontrol, I now still initialize it in opcontrol, just not in the while true loop.

1 Like