public class Solenoid extends SolenoidBase implements LiveWindowSendable
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
kAnalogInputChannels, kAnalogOutputChannels, kDigitalChannels, kPCMModules, kPDPChannels, kPDPModules, kPwmChannels, kRelayChannels, kSolenoidChannels, kSystemClockTicksPerMicrosecond
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.
|
java.lang.String |
getSmartDashboardType()
The string representation of the named data type that will be used by the smart dashboard for
this
Sendable . |
ITable |
getTable()
The table that is associated with this
Sendable . |
void |
initTable(ITable subtable)
Initializes a table for this
Sendable object. |
boolean |
isBlackListed()
Check if solenoid is blacklisted.
|
void |
set(boolean on)
Set the value of a solenoid.
|
void |
startLiveWindowMode()
Start having this sendable object automatically respond to value changes reflect the value on
the table.
|
void |
stopLiveWindowMode()
Stop having this sendable object automatically respond to value changes.
|
void |
updateTable()
Update the table for this sendable object with the latest values.
|
clearAllPCMStickyFaults, getAll, getPCMSolenoidBlackList, getPCMSolenoidVoltageFault, getPCMSolenoidVoltageStickyFault
checkAnalogInputChannel, checkAnalogOutputChannel, checkDigitalChannel, checkPDPChannel, checkPDPModule, checkPWMChannel, checkRelayChannel, checkSolenoidChannel, checkSolenoidModule, getDefaultSolenoidModule, setDefaultSolenoidModule
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 SensorBase
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 java.lang.String getSmartDashboardType()
Sendable
Sendable
.getSmartDashboardType
in interface Sendable
Sendable
.public void initTable(ITable subtable)
Sendable
Sendable
object.public ITable getTable()
Sendable
Sendable
.public void updateTable()
LiveWindowSendable
updateTable
in interface LiveWindowSendable
public void startLiveWindowMode()
LiveWindowSendable
startLiveWindowMode
in interface LiveWindowSendable
public void stopLiveWindowMode()
LiveWindowSendable
stopLiveWindowMode
in interface LiveWindowSendable