Rtos API example

Embed: (wiki syntax)

« Back to documentation index

wait_api functions

wait_api functions
[Platform]

Functions

void wait (float s)
 Generic wait functions.
void wait_ms (int ms)
 Waits a number of milliseconds.
void wait_us (int us)
 Waits a number of microseconds.

Function Documentation

void wait ( float  s )

Generic wait functions.

These provide simple NOP type wait capabilities.

Example:

 #include "mbed.h"

 DigitalOut heartbeat(LED1);

 int main() {
     while (1) {
         heartbeat = 1;
         wait(0.5);
         heartbeat = 0;
         wait(0.5);
     }
 }

Waits for a number of seconds, with microsecond resolution (within the accuracy of single precision floating point).

Parameters:
snumber of seconds to wait

Definition at line 24 of file mbed_wait_api_no_rtos.c.

void wait_ms ( int  ms )

Waits a number of milliseconds.

Parameters:
msthe whole number of milliseconds to wait

Definition at line 28 of file mbed_wait_api_no_rtos.c.

void wait_us ( int  us )

Waits a number of microseconds.

Parameters:
usthe whole number of microseconds to wait

Definition at line 32 of file mbed_wait_api_no_rtos.c.