Package edu.wpi.first.wpilibj
Class DoubleSolenoid
- java.lang.Object
-
- edu.wpi.first.wpilibj.SendableBase
-
- edu.wpi.first.wpilibj.SolenoidBase
-
- edu.wpi.first.wpilibj.DoubleSolenoid
-
- All Implemented Interfaces:
Sendable
,AutoCloseable
public class DoubleSolenoid extends SolenoidBase
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 class
DoubleSolenoid.Value
Possible 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 void
close()
DoubleSolenoid.Value
get()
Read the current value of the solenoid.void
initSendable(SendableBuilder builder)
Initializes thisSendable
object.boolean
isFwdSolenoidBlackListed()
Check if the forward solenoid is blacklisted.boolean
isRevSolenoidBlackListed()
Check if the reverse solenoid is blacklisted.void
set(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 edu.wpi.first.wpilibj.SendableBase
addChild, free, getName, getSubsystem, 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:
close
in interfaceAutoCloseable
- Overrides:
close
in classSendableBase
-
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:Sendable
Initializes thisSendable
object.- Parameters:
builder
- sendable builder
-
-