public class Compressor extends SensorBase implements LiveWindowSendable
Solenoid
object is created.
For most cases, a Compressor object does not need to be instantiated or used in a robot program.
This class is only required in cases where the robot program needs a more detailed status of the
compressor or to enable/disable closed loop control.
Note: you cannot operate the compressor directly from this class as doing so would circumvent the safety provided by using the pressure switch and closed loop control. You can only turn off closed loop control, thereby stopping the compressor from operating.
kAnalogInputChannels, kAnalogOutputChannels, kDigitalChannels, kPCMModules, kPDPChannels, kPDPModules, kPwmChannels, kRelayChannels, kSolenoidChannels, kSystemClockTicksPerMicrosecond
Constructor and Description |
---|
Compressor()
Makes a new instance of the compressor using the default PCM ID of 0.
|
Compressor(int module)
Makes a new instance of the compressor using the provided CAN device ID.
|
Modifier and Type | Method and Description |
---|---|
void |
clearAllPCMStickyFaults()
Clear ALL sticky faults inside PCM that Compressor is wired to.
|
boolean |
enabled()
Get the status of the compressor.
|
boolean |
getClosedLoopControl()
Gets the current operating mode of the PCM.
|
double |
getCompressorCurrent()
Get the current being used by the compressor.
|
boolean |
getCompressorCurrentTooHighFault()
If PCM is in fault state : Compressor Drive is disabled due to compressor current being too
high.
|
boolean |
getCompressorCurrentTooHighStickyFault()
If PCM sticky fault is set : Compressor is disabled due to compressor current being too
high.
|
boolean |
getCompressorNotConnectedFault()
If PCM is in fault state : Compressor does not appear to be wired, i.e.
|
boolean |
getCompressorNotConnectedStickyFault()
If PCM sticky fault is set : Compressor does not appear to be wired, i.e.
|
boolean |
getCompressorShortedFault() |
boolean |
getCompressorShortedStickyFault() |
boolean |
getPressureSwitchValue()
Get the pressure switch value.
|
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. |
void |
setClosedLoopControl(boolean on)
Set the PCM in closed loop control mode.
|
void |
start()
Start the compressor running in closed loop control mode.
|
void |
startLiveWindowMode()
Start having this sendable object automatically respond to value changes reflect the value on
the table.
|
void |
stop()
Stop the compressor from running in closed loop control mode.
|
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.
|
checkAnalogInputChannel, checkAnalogOutputChannel, checkDigitalChannel, checkPDPChannel, checkPDPModule, checkPWMChannel, checkRelayChannel, checkSolenoidChannel, checkSolenoidModule, free, getDefaultSolenoidModule, setDefaultSolenoidModule
public Compressor(int module)
module
- The PCM CAN device ID (0 - 62 inclusive)public Compressor()
Additional modules can be supported by making a new instance and specifying the CAN ID.
public void start()
Use the method in cases where you would like to manually stop and start the compressor for applications such as conserving battery or making sure that the compressor motor doesn't start during critical operations.
public void stop()
Use the method in cases where you would like to manually stop and start the compressor for applications such as conserving battery or making sure that the compressor motor doesn't start during critical operations.
public boolean enabled()
public boolean getPressureSwitchValue()
public double getCompressorCurrent()
public void setClosedLoopControl(boolean on)
on
- if true sets the compressor to be in closed loop control mode (default)public boolean getClosedLoopControl()
public boolean getCompressorCurrentTooHighFault()
public boolean getCompressorCurrentTooHighStickyFault()
public boolean getCompressorShortedStickyFault()
public boolean getCompressorShortedFault()
public boolean getCompressorNotConnectedStickyFault()
public boolean getCompressorNotConnectedFault()
public void clearAllPCMStickyFaults()
If a sticky fault is set, then it will be persistently cleared. The compressor might momentarily disable while the flags are being cleared. Doo not call this method too frequently, otherwise normal compressor functionality may be prevented.
If no sticky faults are set then this call will have no effect.
public void startLiveWindowMode()
LiveWindowSendable
startLiveWindowMode
in interface LiveWindowSendable
public void stopLiveWindowMode()
LiveWindowSendable
stopLiveWindowMode
in interface LiveWindowSendable
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