Skip to content

Commit 67f1a6f

Browse files
committed
Update the wait API example
1 parent 8fa3202 commit 67f1a6f

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

platform/mbed_wait_api.h

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,22 @@ extern "C" {
4040
* Example:
4141
* @code
4242
* #include "mbed.h"
43-
*
44-
* DigitalOut heartbeat(LED1);
45-
*
43+
*
44+
* // Blinking rate in milliseconds
45+
* #define BLINKING_RATE_MS 500
46+
* DigitalOut led(LED2);
47+
* InterruptIn button(SW2);
48+
*
49+
* void blink_led() {
50+
* led = 1;
51+
* wait_us(BLINKING_RATE_MS * 1000);
52+
* led = 0;
53+
* }
54+
*
4655
* int main() {
47-
* while (1) {
48-
* heartbeat = 1;
49-
* wait_us(500);
50-
* heartbeat = 0;
51-
* wait_us(500);
56+
* button.fall(&blink_led);
57+
* while(1) {
58+
* // Do nothing
5259
* }
5360
* }
5461
* @endcode

0 commit comments

Comments
 (0)