Purpose
Delay a task in time or make it repeat periodically without blocking the CrcDuino.
When to use
When you want to run something after x ms or each x ms.
Where to use
Inside the loop function, after having declared a variable with the correct type.
Note |
---|
The timer needs to retain its value and, as such, should generally be declared in the global scope. |
Returns
Timer.Start()
and Timer.Next()
do not return anything. Timer.IsFinished()
returns true
if the requested time has elapsed or false
if it has not.
Main prototype and parameters
void Crc::CrcLib::Timer::Start(unsigned long delay_ms)
The following parameters must be passed to the function for it to work properly:
The delay the timer wants to wait for, in milliseconds.
bool Crc::CrcLib::Timer::IsFinished()
The following parameters must be passed to the function for it to work properly:
No parameters needed.
void Crc::CrcLib::Timer::Next()
The following parameters must be passed to the function for it to work properly:
No parameters needed.
Overloads
This function does not have any overloads. It can only be used as described by the main prototype.
Examples
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Related articles
Filter by label (Content by label) | ||||||
---|---|---|---|---|---|---|
|