Timer {FR}
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.
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. Timer.IsWaiting()
returns true
if the requested time has not yet elapsed but a timer was started, false
otherwise.
Main prototype and parameters
void 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 CrcLib::Timer::IsFinished()
The following parameters must be passed to the function for it to work properly:
No parameters needed.
bool CrcLib::Timer::IsWaiting()
The following parameters must be passed to the function for it to work properly:
No parameters needed.
void 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.