if you dont want to just use the default code and would rather write it yourself to fully learn how it works, you can do something like this..
Put a line in the default routine that will call a function that will check the compressors pressure (whether the pressure switch is on or off).
If the switch's input goes high, turn on the compressor. Then when there is enough pressure the switch will change states and you can turn the compressor off.
In our program, we made "Compressor" an alias for a relay output (Relay 3 in our case), and "CompSwitch" an alias for the digital input the pressure switch was on. You can code these lines in the "user_routines.h" file with the syntax
Code:
#alias NewName OldName
Our Compressor checking function looked like this.
Code:
void CheckComp(void)
{
if(CompSwitch == 1)
{
Compressor = 1;
}
else
{
Compressor = 0;
}
}