|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.wpi.first.wpilibj.SensorBase
edu.wpi.first.wpilibj.Watchdog
public class Watchdog
Watchdog timer class. The watchdog timer is designed to keep the robots safe. The idea is that the robot program must constantly "feed" the watchdog otherwise it will shut down all the motor outputs. That way if a program breaks, rather than having the robot continue to operate at the last known speed, the motors will be shut down. This is serious business. Don't just disable the watchdog. You can't afford it! http://thedailywtf.com/Articles/_0x2f__0x2f_TODO_0x3a__Uncomment_Later.aspx
Field Summary | |
---|---|
static double |
kDefaultWatchdogExpiration
Default expiration for the watchdog in seconds |
Fields inherited from class edu.wpi.first.wpilibj.SensorBase |
---|
kAnalogChannels, kAnalogModules, kDigitalChannels, kPwmChannels, kRelayChannels, kSolenoidChannels, kSolenoidModules, kSystemClockTicksPerMicrosecond |
Constructor Summary | |
---|---|
protected |
Watchdog()
The Watchdog is born. |
Method Summary | |
---|---|
void |
feed()
Throw the dog a bone. |
boolean |
getEnabled()
Find out if the watchdog is currently enabled or disabled (mortal or immortal). |
double |
getExpiration()
Read what the current expiration is. |
static Watchdog |
getInstance()
Get an instance of the watchdog |
double |
getTimer()
Read how long it has been since the watchdog was last fed. |
boolean |
isAlive()
Check in on the watchdog and make sure he's still kicking. |
boolean |
isSystemActive()
Check on the overall status of the system. |
void |
kill()
Put the watchdog out of its misery. |
void |
setEnabled(boolean enabled)
Enable or disable the watchdog timer. |
void |
setExpiration(double expiration)
Configure how many seconds your watchdog can be neglected before it starves to death. |
Methods inherited from class edu.wpi.first.wpilibj.SensorBase |
---|
checkAnalogChannel, checkAnalogModule, checkDigitalChannel, checkDigitalModule, checkPWMChannel, checkPWMModule, checkRelayChannel, checkRelayModule, checkSolenoidChannel, checkSolenoidModule, free, getDefaultAnalogModule, getDefaultDigitalModule, getDefaultSolenoidModule, setDefaultAnalogModule, setDefaultDigitalModule, setDefaultSolenoidModule |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double kDefaultWatchdogExpiration
Constructor Detail |
---|
protected Watchdog()
Method Detail |
---|
public static Watchdog getInstance()
public void feed()
public void kill()
public double getTimer()
public double getExpiration()
public void setExpiration(double expiration)
expiration
- The number of seconds before starvation following a meal (watchdog starves if it doesn't eat this often).public boolean getEnabled()
public void setEnabled(boolean enabled)
enabled
- Enable or disable the watchdog.public boolean isAlive()
public boolean isSystemActive()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |