Hey Junkyard, that sounds like an "engineer" answer. I was thinking Pico was looking for a "programmer" answer.

(Or maybe he needs an electrical technician's answer.)
In any case, here's my programmer answer:
FIRST gave you two switches this year. They are preset to trigger at two different pressures. If you turn the pump on when the lower pressure switch closes, and turn it off when the high pressure switch opens, you will prevent the pump from cycling excessively (which is what your electrical people want you, the programmer, to do.)
There are other threads that also tell you how to do this, but I will give you my answer here:
Code:
'( Make sure you know which switch is which before you use this code.)
if low_pressure_switch = 0 then DontTurnOn
' The low pressure switch is closed, (and the high pressure
' switch is assumed to be also) so turn on the compressor.
pumpRelayOn = 1
DontTurnOn:
if high_pressure_switch = 1 then DontTurnOff
' The high pressure switch is open, (and the low pressure
' switch is assumed to be also) so turn the compressor off.
pumpRelayOn = 0
DontTurnOff:
If you don't want to take the trouble to figure out which switch is which, this code should work:
Code:
if (switch1 = 0) or (switch2 = 0) then DontTurnOn
' Both of the switches are closed, so turn on the
' compressor.
pumpRelayOn = 1
DontTurnOn:
if (switch1 = 1) or (switch2 = 1) then DontTurnOff
' Both of the switches are now open, so turn the
' compressor off.
pumpRelayOn = 0
DontTurnOff: