api / mbed / trunk / wait_api

wait

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);
    }
}
waitGeneric wait functions.
Functions
waitWaits for a number of seconds, with microsecond resolution (within the accuracy of single precision floating point).
wait_msWaits a number of milliseconds.
wait_usWaits a number of microseconds.

Functions

wait

void wait(float s)

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

Variables

snumber of seconds to wait

wait_ms

void wait_ms(int ms)

Waits a number of milliseconds.

Variables

msthe whole number of milliseconds to wait

wait_us

void wait_us(int us)

Waits a number of microseconds.

Variables

usthe whole number of microseconds to wait
void wait(float s)
Waits for a number of seconds, with microsecond resolution (within the accuracy of single precision floating point).
void wait_ms(int ms)
Waits a number of milliseconds.
void wait_us(int us)
Waits a number of microseconds.