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()) {
leftWing.set_value(true);
pros::delay(5000);
}

It’s pronounced cylinder :wink:
IMG_2052

2 Likes

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

7 Likes

Finally. Someone said it.

13 Likes

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