Hook up your compressor to a spike, so that the red lead is attached to the M+ output and so that the black lead is connected to your ground junction. In your code, turn that relay on and off.
So, if you used relay1, the code would look something like this..
Code:
void TurnOnComp(void)
{
relay1_fwd=1;
}
void TurnOffComp(void)
{
relay1_fwd=0;
}