Pneumatic Problem, Please HELP!

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!

#pragma config(Sensor, dgtl3,  pistonOne,      sensorDigitalOut)
#pragma config(Sensor, dgtl2,  pistonTwo,      sensorDigitalOut)
#pragma config(Motor,  port2,           Lmotor,        tmotorVex393_MC29, openLoop, driveLeft)
#pragma config(Motor,  port3,           Rmotor,        tmotorVex393_MC29, openLoop, reversed, driveRight)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{

	while(true)
	{

		motor [Lmotor] = vexRT [Ch3] / 2;
		motor [Rmotor] = vexRT [Ch3] / 2;

		motor [Lmotor] = vexRT [Ch1] / 2;
		motor [Rmotor] = vexRT [Ch1] / -2;

		if(vexRT [Btn8L] == 1)
		{

			SensorValue [pistonOne] = 1;

			wait1Msec(100);

			SensorValue [pistonOne] = 0;

		}

		else if(vexRT [Btn8R] == 1)
		{

			SensorValue [pistonTwo] = 1;

			wait1Msec(100);

			SensorValue [pistonTwo] = 0;

		}

		else
		{

			SensorValue [pistonOne] = 0;
			SensorValue [pistonTwo] = 0;

		}

	}

}

P.S: This is a code we use to test both pneumatic system and motors, just saying if anyone was confused.

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.

Hello, we are going to try to test pneumatic system with this code:

#pragma config(Sensor, dgtl3,  pistonOne,      sensorDigitalOut)
#pragma config(Sensor, dgtl2,  pistonTwo,      sensorDigitalOut)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{

	while(true)
	{

		if(vexRT [Btn8L] == 1)
		{

			SensorValue [pistonOne] = 1;

		}

		else
		{
			
			SensorValue [pistonOne] = 0;		
		
		}

		if(vexRT [Btn8R] == 1)
		{

			SensorValue [pistonTwo] = 1;

		}

		else
		{
			
			SensorValue [pistonTwo] = 0;	
		
		}
		
	}

}

Basically what you recommended, but wanted to make sure we didn’t do anything wrong.

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.

Hey, we done goofed, that was the wrong code. We are actually using bump sensors to test it with debug window opened.

#pragma config(Sensor, dgtl2,  pistonTwo,      sensorDigitalOut)
#pragma config(Sensor, dgtl3,  pistonOne,      sensorDigitalOut)
#pragma config(Sensor, dgtl4,  Btn1,           sensorTouch)
#pragma config(Sensor, dgtl5,  Btn2,           sensorTouch)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{

	while(true)
	{

		if(SensorValue [Btn1] == 1)
		{

			SensorValue [pistonOne] = 1;

		}

		else
		{
			
			SensorValue [pistonOne] = 0;		
		
		}

		if(SensorValue [Btn2] == 1)
		{

			SensorValue [pistonTwo] = 1;

		}

		else
		{
			
			SensorValue [pistonTwo] = 0;	
		
		}
		
	}

}

Yeah, we really done goofed!

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