As far know, there is no "Set" method in the Compressor object even in the base classes it inherited from. In any case, if the compressor is wired correctly with a pressure switch, you shouldn't have to do much about the compressor object. Just instantiate it, start it and forget about it. When the compressor object is instantiated, a compressor task is started automatically, this task will check if the compressor has been enabled by Start(). If so, it will monitor the pressure switch and automatically turn the relay on and off if necessary to maintain the pressure. In other words, you can just do the following with the compressor object in the constructor of your robot and nothing else. Don't use a joystick button to turn the compressor on and off. It is automatic. You don't even have to destroy the compressor in the destructor because the robot code will never end anyway, but it would be a cleaner habit of coding.
Code:
class BuiltinDefaultCode : public IterativeRobot
{
private:
Compressor *m_compressor;
...
public:
BuiltinDefaultCode()
{
...
m_compressor = new Compressor(1, 1);
m_compressor->Start();
...
}
~BuiltinDefaultCode()
{
....
m_compressor->Stop();
delete m_compressor;
....
}
}