We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fa3202 commit 67f1a6fCopy full SHA for 67f1a6f
platform/mbed_wait_api.h
@@ -40,15 +40,22 @@ extern "C" {
40
* Example:
41
* @code
42
* #include "mbed.h"
43
- *
44
- * DigitalOut heartbeat(LED1);
45
+ *
+ * // Blinking rate in milliseconds
+ * #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
55
* int main() {
- * while (1) {
- * heartbeat = 1;
- * wait_us(500);
- * heartbeat = 0;
56
+ * button.fall(&blink_led);
57
+ * while(1) {
58
+ * // Do nothing
59
* }
60
61
* @endcode
0 commit comments