Package edu.wpi.first.wpilibj
Class DoubleSolenoid
- java.lang.Object
-
- edu.wpi.first.wpilibj.SolenoidBase
-
- edu.wpi.first.wpilibj.DoubleSolenoid
-
- All Implemented Interfaces:
Sendable,AutoCloseable
public class DoubleSolenoid extends SolenoidBase implements Sendable, AutoCloseable
DoubleSolenoid class for running 2 channels of high voltage Digital Output on the PCM.The DoubleSolenoid class is typically used for pneumatics solenoids that have two positions controlled by two separate channels.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDoubleSolenoid.ValuePossible values for a DoubleSolenoid.
-
Field Summary
-
Fields inherited from class edu.wpi.first.wpilibj.SolenoidBase
m_moduleNumber
-
-
Constructor Summary
Constructors Constructor Description DoubleSolenoid(int forwardChannel, int reverseChannel)Constructor.DoubleSolenoid(int moduleNumber, int forwardChannel, int reverseChannel)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()DoubleSolenoid.Valueget()Read the current value of the solenoid.voidinitSendable(SendableBuilder builder)Initializes thisSendableobject.booleanisFwdSolenoidBlackListed()Check if the forward solenoid is blacklisted.booleanisRevSolenoidBlackListed()Check if the reverse solenoid is blacklisted.voidset(DoubleSolenoid.Value value)Set the value of a solenoid.-
Methods inherited from class edu.wpi.first.wpilibj.SolenoidBase
clearAllPCMStickyFaults, clearAllPCMStickyFaults, getAll, getAll, getPCMSolenoidBlackList, getPCMSolenoidBlackList, getPCMSolenoidVoltageFault, getPCMSolenoidVoltageFault, getPCMSolenoidVoltageStickyFault, getPCMSolenoidVoltageStickyFault
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.wpi.first.wpilibj.Sendable
addChild, getName, getSubsystem, setName, setName, setName, setName, setSubsystem
-
-
-
-
Constructor Detail
-
DoubleSolenoid
public DoubleSolenoid(int forwardChannel, int reverseChannel)Constructor. Uses the default PCM ID (defaults to 0).- Parameters:
forwardChannel- The forward channel number on the PCM (0..7).reverseChannel- The reverse channel number on the PCM (0..7).
-
DoubleSolenoid
public DoubleSolenoid(int moduleNumber, int forwardChannel, int reverseChannel)Constructor.- Parameters:
moduleNumber- The module number of the solenoid module to use.forwardChannel- The forward channel on the module to control (0..7).reverseChannel- The reverse channel on the module to control (0..7).
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
set
public void set(DoubleSolenoid.Value value)
Set the value of a solenoid.- Parameters:
value- The value to set (Off, Forward, Reverse)
-
get
public DoubleSolenoid.Value get()
Read the current value of the solenoid.- Returns:
- The current value of the solenoid.
-
isFwdSolenoidBlackListed
public boolean isFwdSolenoidBlackListed()
Check if the forward solenoid is blacklisted. If a solenoid is shorted, it is added to the blacklist and disabled until power cycle, or until faults are cleared.- Returns:
- If solenoid is disabled due to short.
- See Also:
SolenoidBase.clearAllPCMStickyFaults()
-
isRevSolenoidBlackListed
public boolean isRevSolenoidBlackListed()
Check if the reverse solenoid is blacklisted. If a solenoid is shorted, it is added to the blacklist and disabled until power cycle, or until faults are cleared.- Returns:
- If solenoid is disabled due to short.
- See Also:
SolenoidBase.clearAllPCMStickyFaults()
-
initSendable
public void initSendable(SendableBuilder builder)
Description copied from interface:SendableInitializes thisSendableobject.- Specified by:
initSendablein interfaceSendable- Parameters:
builder- sendable builder
-
-