public class Solenoid extends SolenoidBase implements Sendable
The Solenoid class is typically used for pneumatic solenoids, but could be used for any device within the current spec of the PCM.
m_moduleNumber
Constructor and Description |
---|
Solenoid(int channel)
Constructor using the default PCM ID (defaults to 0).
|
Solenoid(int moduleNumber,
int channel)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
free()
Destructor.
|
boolean |
get()
Read the current value of the solenoid.
|
void |
initSendable(SendableBuilder builder)
Initializes this
Sendable object. |
boolean |
isBlackListed()
Check if solenoid is blacklisted.
|
void |
set(boolean on)
Set the value of a solenoid.
|
void |
setPulseDuration(double durationSeconds)
Set the pulse duration in the PCM.
|
void |
startPulse()
Trigger the PCM to generate a pulse of the duration set in
setPulseDuration.
|
clearAllPCMStickyFaults, clearAllPCMStickyFaults, getAll, getAll, getPCMSolenoidBlackList, getPCMSolenoidBlackList, getPCMSolenoidVoltageFault, getPCMSolenoidVoltageFault, getPCMSolenoidVoltageStickyFault, getPCMSolenoidVoltageStickyFault
addChild, getName, getSubsystem, setName, setName, setName, setSubsystem
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName, getSubsystem, setName, setName, setSubsystem
public Solenoid(int channel)
channel
- The channel on the PCM to control (0..7).public Solenoid(int moduleNumber, int channel)
moduleNumber
- The CAN ID of the PCM the solenoid is attached to.channel
- The channel on the PCM to control (0..7).public void free()
free
in class SendableBase
public void set(boolean on)
on
- True will turn the solenoid output on. False will turn the solenoid output off.public boolean get()
public boolean isBlackListed()
SolenoidBase.clearAllPCMStickyFaults()
public void setPulseDuration(double durationSeconds)
durationSeconds
- The duration of the pulse, from 0.01 to 2.55 seconds.startPulse()
public void startPulse()
setPulseDuration(double)
public void initSendable(SendableBuilder builder)
Sendable
Sendable
object.initSendable
in interface Sendable
builder
- sendable builder