Re: How to program solenoid and compressor?
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);
|