View Single Post
  #6   Spotlight this post!  
Unread 01-30-2010, 04:37 PM
bamse bamse is offline
UFO Designer
AKA: Fredrik
FRC #2745 (Some Assembly Required)
Team Role: Mentor
 
Join Date: Nov 2009
Rookie Year: 2009
Location: San Antonio
Posts: 1
bamse is an unknown quantity at this point
Thumbs down 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);
Reply With Quote