PreviousNext
waitDelay
Help > OS functions > Timing > waitDelay

Function

 

Wait the specified number of ticks

Purpose

 

Time delay generation

Syntax

 

void waitDelay(uns8 ticks)

Parameters

 

ticks – time to wait in 10 ms periods (1 - 255)

Return value

 

  –

Output values

 

  –

Preconditions

 

     This function can be combined with waitMS.

     This function must not be combined with startDelay and startLongDelay

Remarks

 

This is the active waiting (on OS foreground). No other operation runs on OS foreground during waiting.

Side effects

 

Internal ticks are based on the internal RC oscillator if RF IC is sleeping. Thus, the delay can vary with temperature, etc. in this case. See MCU datasheet.

See also

 

waitMS, startDelay, startLongDelay

Example 1

 

     // LED on for 0.5 s

_LED = 1;

waitDelay(50);      // Delay 500 ms. Program stays here for 500 ms

_LED = 0;           // and continues here just after the period elapsed.