pneumatics with easyC

Our team is using easyC and I was wondering how we start programming the pneumatics. We think we’re going to use 3 buttons, one for piston #1, one for piston #2, and one to turn the air compressor on/off. We’ve finished programming the motor controls so we have a good handle on the code and how it works. If someone could give us some advice to get us started that’d be great.

The pistons are controlled with a spike, so you just have to use a relay on the RC to control them and map that to the buttons. The air compressor needs the pressure switch and doesn’t need a button, it will turn off if there is pressure and on if it needs to build some up. If you still want to have the button control the compressor you can put the pressure switch block in easyC inside of an if statement for the button, but I think just letting it do its thing would be fine, unless your concerned with battery life or something…

Okay. So for the relay output, what does the -1 = ignore, 0 = off, and 1 = on mean for the forward and the reverse?

There are different ways to wire the pneumatics, which determines how you command the spikes, but here’s how we do it for the double action solenoid. We run the red from one side and the black from the other side of the valve together, so you have 2 pairs of black/red wires to connect to the spike. You can connect these to either side (+/-); it doesn’t really matter because 1) you can always switch the tubing and 2) you are usually just trying to change the state of the cylinder in or out, just click it again and it goes the other way. For a given state (say, extend widget), you will command positive on (1) and negative off (0), which will make the solenoids activate the valve in one direction. For the opposite state (retract widget), command positive off (0) and negative on (1), which makes the solenoids (and the valve) move in the other direction.