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:9a2d6e5f53d0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Sep 25 16:01:36 2018 +0000
@@ -0,0 +1,25 @@
+/****************************************************************
+/ Simple program to show basic program structure
+/
+/ The program flashes onboard LED #1, #2 and #3 on/off in sequence for 1 second and continues this indefinitely.
+*************************************************************/
+
+#include "mbed.h"
+
+DigitalOut myled(p23);                    // use onboard LED #1 (red)
+DigitalOut myled2(p25);                    // use onboard LED #2 (green)
+DigitalOut myled3(p24);                    // use onboard LED #3 (yellow)
+
+int main() {
+ 
+    while(1) {                            // repeat indefinitely
+        myled = 1;                        // turn on LED #1
+        myled2 = 1;                       // turn on LED #2
+        myled3 = 1;                       // turn on LED #3
+        wait(1);                         // wait 1s
+        myled = 0;                       // turn off LED #1
+        myled2 = 0;                       // turn off LED #2
+        myled3 = 0;                       // turn off LED #3
+        wait(1);                       // wait 1s
+    }       
+}
\ No newline at end of file