Timers

periodic()

Description

It executes a function the user inputs periodically every specific (ms) inputted by the user using the desired timer one or two that the user inputs or it will look for a free timer by its own if you input nothing.

Syntax

Timers_class.periodic(msec,FunctionName,TimerID)

Parameters

msec: The time in msec the function pointed to shall be executed periodically after the function has been called (int)

FunctionName: ex. bool Funcion_Name(void) { return 0; } you should input Function_Name as the argument .

TimerID: the timer required to handle the periodic call for the inputted function .0 acquires Timer1 and 1 acquires Timer2 if you do not input the timer ID it will automatically look for the free timer (int)

Returns

It returns the timer ID that has been acquired correctly to handle the periodic call (int)

-1 in the case that it could not find a free timer or acquire the inputted timer ID

-2 *

-3 if the msec input is less than 0 and will also detach the interrupt associated with it and releases the timer

  

Share |