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.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:09571003fc2e
- Child:
- 1:0a1e7d18b69c
diff -r 000000000000 -r 09571003fc2e main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Sep 20 18:49:31 2018 +0000
@@ -0,0 +1,30 @@
+#include "mbed.h"
+#include "time.h"
+
+DigitalOut myled[5] = {p25, p26, p27, p28, p29};
+
+
+
+int main() {
+
+ int i = 0;
+
+ char enter_key;
+
+ Timer t;
+ t.start();
+
+ printf("Ready?\n\r");
+ scanf("%c", &enter_key);
+ srand(t.read_ms());
+
+ while(1) {
+ i = (rand()%4);
+ myled[i] = 1;
+ wait(1);
+ myled[i] = 0;
+ printf("%d\n\r", i);
+ }
+
+
+}