public final class MotorSafetyHelper extends java.lang.Object
Constructor and Description |
---|
MotorSafetyHelper(MotorSafety safeObject)
The constructor for a MotorSafetyHelper object.
|
Modifier and Type | Method and Description |
---|---|
void |
check()
Check if this motor has exceeded its timeout.
|
static void |
checkMotors()
Check the motors to see if any have timed out.
|
void |
feed()
Feed the motor safety object.
|
double |
getExpiration()
Retrieve the timeout value for the corresponding motor safety object.
|
boolean |
isAlive()
Determine of the motor is still operating or has timed out.
|
boolean |
isSafetyEnabled()
Return the state of the motor safety enabled flag Return if the motor safety is currently
enabled for this devicce.
|
void |
setExpiration(double expirationTime)
Set the expiration time for the corresponding motor safety object.
|
void |
setSafetyEnabled(boolean enabled)
Enable/disable motor safety for this device Turn on and off the motor safety option for this
PWM object.
|
public MotorSafetyHelper(MotorSafety safeObject)
safeObject
- a pointer to the motor object implementing MotorSafety. This is used to call
the Stop() method on the motor.public void feed()
public void setExpiration(double expirationTime)
expirationTime
- The timeout value in seconds.public double getExpiration()
public boolean isAlive()
public void check()
public void setSafetyEnabled(boolean enabled)
enabled
- True if motor safety is enforced for this objectpublic boolean isSafetyEnabled()
public static void checkMotors()