Init(TIMER,...)
Description
Initialize custom callback period timer.
Syntax
Init(TIMER, period);
Parameters
Variable | Input |
|---|---|
| This defines custom callback timer. Only one is present at the moment - TIMER1 |
| Period defines callback period time in ms. Can be any number from 1 to 65535. |
Returns
Return value | Return explanation |
SCRIPT_OPERATION_SUCCESS | Success |
SCRIPT_NO_ACCESS | Peripheral already initialized. |
SCRIPT_PARAM_INVALID | Passed value is too large. |
Function call example
Timer initialization example
public callback (event)
{
switch(event)
{
case TIMER1:
{
DoSomethingHere();
}
}
}
main(){
Init(TIMER1, 50);
while(1){
Delay(100);
}
}