public class SafePWM extends PWM implements MotorSafety
PWM.PeriodMultiplier
kAnalogInputChannels, kAnalogOutputChannels, kDigitalChannels, kPCMModules, kPDPChannels, kPDPModules, kPwmChannels, kRelayChannels, kSolenoidChannels, kSystemClockTicksPerMicrosecond
DEFAULT_SAFETY_EXPIRATION
Constructor and Description |
---|
SafePWM(int channel)
Constructor for a SafePWM object taking a channel number.
|
Modifier and Type | Method and Description |
---|---|
void |
disable() |
void |
Feed()
Feed the MotorSafety timer.
|
java.lang.String |
getDescription() |
double |
getExpiration()
Return the expiration time for the PWM object.
|
boolean |
isAlive()
Check if the PWM object is currently alive or stopped due to a timeout.
|
boolean |
isSafetyEnabled()
Check if motor safety is enabled for this object.
|
void |
setExpiration(double timeout)
Set the expiration time for the PWM object.
|
void |
setSafetyEnabled(boolean enabled) |
void |
stopMotor()
Stop the motor associated with this PWM object.
|
enableDeadbandElimination, free, getChannel, getPosition, getRaw, getRawBounds, getSmartDashboardType, getSpeed, getTable, initTable, setBounds, setDisabled, setPeriodMultiplier, setPosition, setRaw, setRawBounds, setSpeed, setZeroLatch, startLiveWindowMode, stopLiveWindowMode, updateTable
checkAnalogInputChannel, checkAnalogOutputChannel, checkDigitalChannel, checkPDPChannel, checkPDPModule, checkPWMChannel, checkRelayChannel, checkSolenoidChannel, checkSolenoidModule, getDefaultSolenoidModule, setDefaultSolenoidModule
public SafePWM(int channel)
channel
- The channel number to be used for the underlying PWM object. 0-9 are on-board,
10-19 are on the MXP port.public void setExpiration(double timeout)
setExpiration
in interface MotorSafety
timeout
- The timeout (in seconds) for this motor objectpublic double getExpiration()
getExpiration
in interface MotorSafety
public boolean isAlive()
isAlive
in interface MotorSafety
public void stopMotor()
stopMotor
in interface MotorSafety
public boolean isSafetyEnabled()
isSafetyEnabled
in interface MotorSafety
public void Feed()
public void setSafetyEnabled(boolean enabled)
setSafetyEnabled
in interface MotorSafety
public java.lang.String getDescription()
getDescription
in interface MotorSafety
public void disable()