public class SafePWM extends PWM implements MotorSafety
PWM.PeriodMultiplier
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.
|
void |
Feed()
Deprecated.
Use
feed() instead. |
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, getSpeed, initSendable, setBounds, setDisabled, setPeriodMultiplier, setPosition, setRaw, setSpeed, setZeroLatch
addChild, getName, getSubsystem, setName, setName, setName, setSubsystem
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName, getSubsystem, setName, setName, setSubsystem
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
@Deprecated public void Feed()
feed()
instead.public void feed()
public void setSafetyEnabled(boolean enabled)
setSafetyEnabled
in interface MotorSafety
public java.lang.String getDescription()
getDescription
in interface MotorSafety
public void disable()