The compressor WILL NOT RUN without the pressure switch connected, this is because the switch is a normally closed contact, that goes open when its reached pressure.
The code you showed shows Digital In 4 as where its expecting the switch, and Relay 2 as where its outputting the signals. The LEDs on the sidecar near the relay ports will switch when its working.
Also, I highly recommend using pointers instead of directly instantiating your objects:
Code:
class myRobot : public SimpleRobot
{
RobotDrive* driveBase;
Jaguar* someMotor;
Solenoid* someSolenoid;
Compressor* theCompressor;
myRobot(){
driveBase = new RobotDrive(1,2,3,4);
someMotor = new Jaguar(5);
someSolenoid = new Solenoid(1);
theCompressor = new Compressor(1,1);
theCompressor->Start();
}
void Teleop(){
someMotor->Set(1);
}
};
This way, you can pass them by reference, instead of by value, which breaks things. Its good practice.