Kangaroo Library for Arduino
Use reliable Packet Serial to communicate with your Kangaroo.
|
Encapsulates a starting time and duration. More...
Public Member Functions | |
KangarooTimeout (int32_t timeoutMS) | |
boolean | canExpire () const |
boolean | expired () const |
void | expire () |
void | reset () |
Encapsulates a starting time and duration.
The same KangarooTimeout can be reused between different calls.
KangarooTimeout::KangarooTimeout | ( | int32_t | timeoutMS | ) |
Constructs a KangarooTimeout object. The starting time is captured.
timeoutMS | The timeout duration, in milliseconds. |
boolean KangarooTimeout::canExpire | ( | ) | const |
Gets whether the timeout can expire. If the KangarooTimeout was created with a timeout of KANGAROO_INFINITE_TIMEOUT, it cannot expire.
void KangarooTimeout::expire | ( | ) |
Causes the timeout to expire immediately.
boolean KangarooTimeout::expired | ( | ) | const |
Gets whether the timeout has expired.
void KangarooTimeout::reset | ( | ) |
Captures the current time and uses it as the new starting time for the timeout.