Programming Question

I will probably feel stupid after I get an answer.

if(vexRT[Btn5D] == 1) //If button 5U is pressed the hanging fires
		{
			SensorValue[hanging] = 0;
		}
		else
		{
			SensorValue[hanging] = 1;
		}

That is the code for our pneumatic hang. We currently run a 2min match, then hang at the end, but we are out of air. Does that code slowly let out air? What code would be ideal for the pneumatic hang?

I want the pistons to basically be “off” while we drive normal, then at the end I want it to shoot up (when I click a button), then when I release the button the pistons actuate down. What code would do this?

Please let me know ASAP! Thanks!

I don’t completely understand the question, but I think you are trying to say that you do not want the pneumatic to retract when you release the button.

This can be done by saying:

if(vexRT[Btn5D] == 1) //If button 5U is pressed the hanging fires
		{
			SensorValue[hanging] = 0;
		}
		else if(vexRT[Btn5U] == 1) //If button 5D is pressed the hanging retracts
		{
			SensorValue[hanging] = 1;
		}

Alright, I think that code and me changing the fittings helped :slight_smile: Thanks a ton!

Your Welcome