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.
Revision 0:13988e5bca16, committed 2018-11-08
- Comitter:
- lmottola
- Date:
- Thu Nov 08 17:29:13 2018 +0000
- Commit message:
- Initial commit
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed-os.lib | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Nov 08 17:29:13 2018 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+
+Thread thread;
+DigitalOut led1(LED1);
+volatile bool running = true;
+
+// Blink function toggles the led in a long running loop
+void blink(DigitalOut *led) {
+ while (running) {
+ *led = !*led;
+ wait(1);
+ }
+}
+
+// Spawns a thread to run blink for 5 seconds
+int main() {
+ thread.start(callback(blink, &led1));
+ wait(5);
+ running = false;
+ thread.join();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-os.lib Thu Nov 08 17:29:13 2018 +0000 @@ -0,0 +1,1 @@ +https://github.com/armmbed/mbed-os/