View Single Post
  #7   Spotlight this post!  
Unread 02-07-2010, 01:00 AM
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: How to program solenoid and compressor?

Quote:
Originally Posted by bamse View Post
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
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
Reply With Quote