Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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:
-
s number of seconds to wait
- Note:
- If the RTOS is present, this function always spins to get the exact number of microseconds, which potentially affects power (such as preventing deep sleep) and multithread performance. You can avoid it by using Thread::wait().
Definition at line 20 of file mbed_wait_api_stub.cpp.
void wait_ms | ( | int | ms ) |
Waits a number of milliseconds.
- Parameters:
-
ms the whole number of milliseconds to wait
- Note:
- If the RTOS is present, this function always spins to get the exact number of microseconds, which potentially affects power (such as preventing deep sleep) and multithread performance. You can avoid it by using Thread::wait().
Definition at line 23 of file mbed_wait_api_stub.cpp.
void wait_us | ( | int | us ) |
Waits a number of microseconds.
- Parameters:
-
us the whole number of microseconds to wait
- Note:
- If the RTOS is present, this function always spins to get the exact number of microseconds, which potentially affects power (such as preventing deep sleep) and multithread performance.
Definition at line 26 of file mbed_wait_api_stub.cpp.
Generated on Tue Jul 12 2022 12:46:46 by
