You can hook it to a single Spike. Look at the drawing in the attachment.
For the programming, you would fire each solenoid by setting either side of the spike to 1. Ex:
Code:
//Start Compressor Code
relay8_fwd = !rc_dig_in18; //Turn on the compressor when the pressure sensor is closed
relay8_rev = 0; //Without this, the compressor might run backwards or might not run at all
//End Compressor Code
//Start Pneumatic Piston Code
if (p1_sw_top == 1) //If you press the thumb button on the joystick plugged into port one...
{
relay1_rev = 0; //Turn off the extend side of the solenoid
relay1_fwd = 1; //Turn on the retract side of the solenoid
}
if (p1_sw_trig == 1) //If you press the trigger on the joystick plugged into port one...
{
relay1_fwd = 0; //Turn off the retract side of the solenoid
relay1_rev = 1; //Turn on the extend side of the solenoid
}
//End Pneumatic Piston Code
With this code, you will plug the relay into relay port 1, the compressor into relay port 8, and the pressure sensor into digital i/o port 18.