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
Revision 0:9a2d6e5f53d0, committed 2018-09-25
- Comitter:
- matt495
- Date:
- Tue Sep 25 16:01:36 2018 +0000
- Commit message:
- ME21001 exercise 4
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file | 
| mbed.bld | 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	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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Sep 25 16:01:36 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/e95d10626187 \ No newline at end of file