Quote:
Originally Posted by bamse
Howdy...
We had to insert this piece of code in the operatorControl() as well,
// New compressor code...
if (airCompressor.getPressureSwitchValue()) {
airCompressor.setRelayValue(edu.wpi.first.wpilibj. Relay.Value.kOff);
} else {
airCompressor.setRelayValue(edu.wpi.first.wpilibj. Relay.Value.kOn);
}
And don't forget to turn the compressor off when exiting your operatorControl loop...
airCompressor.setRelayValue(edu.wpi.first.wpilibj. Relay.Value.kOff);
|
This is not correct, call the Compressor class tell it the digital input and the spike port and it will take care for you.
ex: Compressor myComp = new Compressor(1,1); //That's all you need