View Single Post
  #5   Spotlight this post!  
Unread 20-02-2010, 17:58
nikRbokRz nikRbokRz is offline
Registered User
FRC #1683
 
Join Date: Jan 2010
Location: Atlanta, GA
Posts: 14
nikRbokRz is an unknown quantity at this point
Re: solenoid problems

Quote:
Originally Posted by Twisted eric View Post
if (fluffy.getPressureSwitchValue()) {
fluffy.setRelayValue(edu.wpi.first.wpilibj. Relay.Value.kOff);
} else {
fluffy.setRelayValue(edu.wpi.first.wpilibj. Relay.Value.kOn);
}


this will i believe to turn off the compressor
(have not yet tried it yet)

also is the only import we need is

import edu.wpi.first.wpilibj.solenoid;

right


thanks.
First of all, instead of doing "edu.wpi.first.wpilibj.Relay.value.kOn", isn't it much easier to just to "Relay.value.kOn"?

From what my team assumed, the compressor automatically turns on/off, depending on the pressure switch. We initially couldn't get it to work, but it turned out to just be a bad spike. So I'm not really sure if you need to be turning it on/off.

As for the solenoid, yes all you need to import is
Code:
import edu.wpi.first.spilibj.Solenoid;
Depending on how you've connected your solenoid(s), you will have to set them true or false to get it to work as you wish.

Hope that helped.
Reply With Quote