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 aea6616 commit 7ef375fCopy full SHA for 7ef375f
Tutorials_UsingAPIs/Flow-Control-EventQueue/README.md
@@ -0,0 +1,3 @@
1
+# Application Flow Control: EventQueue example
2
+
3
+An EventQueue Blinky implementation.
Tutorials_UsingAPIs/Flow-Control-EventQueue/main.cpp
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2020 Arm Limited and affiliates.
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
6
+#include "mbed.h"
7
8
+void flip(DigitalOut &led)
9
+{
10
+ led = !led;
11
+}
12
13
+int main()
14
15
+ DigitalOut led1(LED1);
16
+ DigitalOut led2(LED2);
17
18
+ // creates a queue with the default size
19
+ EventQueue queue;
20
21
+ // events are simple callbacks
22
+ queue.call_every(1000, flip, led1);
23
+ queue.call_every(500, flip, led2);
24
25
+ // events are executed by the dispatch method
26
+ queue.dispatch_forever();
27
0 commit comments