Timers

singleShot()

Description

It executes a function the user inputs only one time after the desired (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 .

Syntax

Timers_class.singleShot(msec,FunctionName,TimerID)

Parameters

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

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

TimerID: the timer required to handle the single shot operation 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 singleShot operation (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 <0 and will also detach the interrupt associated with it and releases the timer

  

Share |