Timer class for non-blocking delays. More...
#include <AS.h>
Public Member Functions | |
uint8_t | done (void) |
Query if the timer has expired. More... | |
void | set (uint32_t ms) |
Start the timer. More... | |
uint32_t | remain (void) |
Query the remaing time until the timer is done. More... | |
Timer class for non-blocking delays.
The following examples shows how to use the waitTimer class to perform an action every 500ms. Note that the first time loop() is called, delay.done() will return true and the action will be performed. The example also shows how to avoid the execution time of the action to influence the new delay time by setting the delay before performing the action.
uint8_t waitTimer::done | ( | void | ) |
Query if the timer has expired.
uint32_t waitTimer::remain | ( | void | ) |
Query the remaing time until the timer is done.
void waitTimer::set | ( | uint32_t | ms | ) |
Start the timer.
ms | Time until timer is done() (unit: ms) |