programming pneumatics problem

we tried to load this program and after it finishes, the program does nothing, the spike we set the double compressor turns green but nothing happens,

heres our code we used:

char flag00 = 1;
char flag01 = 1; //set at top of program

if(p2_sw_trig == 1 && flag00 == 1)
{
relay6_fwd = 1;
relay6_rev = 0;
flag01 = 0;
}
else if(p2_sw_trig == 1 && flag00 == -1)
{
relay6_fwd = 0;
relay6_rev = 1;
flag01 = 0;
}
else if (p2_sw_trig == 0 && flag01 == 0)
{
flag01 = 1;
flag00 = flag00 * -1;
}

is there any problems within the program?

If the spike turns green when it’s supposed to be doing something, i’d say the code is working fine… check the wiring.

Agreed. All the code does is change the state of the spike. After that, the problem lies within the wiring or the pneumatics themselves.

Just checking, but you do realize your relay never turns off, correct? It’ll always either be red or green once you hit your trigger.

But yes, check your solenoid wiring. Also, the solenoids are piloted, so it won’t want to switch if there’s not enough air pressure in the system.

Found out the problem. I didn’t check the entire code and found that the orginal kevin’s code was kinda conflicting the code I wrote for the pneumatics. Hehe my bad… -_- I WANT COFFEE