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.
Diff: main.cpp
- Revision:
- 0:774078f45f9d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu May 31 15:33:24 2018 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+DigitalOut led3(LED3);
+
+// main() runs in its own thread in the OS
+// (note the calls to wait below for delays)
+int main() {
+ int myRandom;
+ while (true) {
+ myRandom = rand() % 100;
+ if (myRandom > 50) led1 = !led1;
+ led2 = !led2;
+ myRandom = rand() % 100;
+ if (myRandom > 50) led3 = !led3;
+ wait(0.5);
+ }
+}
+