UoD ME21001 Group 2 02 / Mbed 2 deprecated exercise4

Dependencies:   mbed

Files at this revision

API Documentation at this revision

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