Task 3.2.1

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
noutram
Date:
Thu Sep 24 12:25:21 2015 +0000
Commit message:
Initial version 24-09-2015

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	Thu Sep 24 12:25:21 2015 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+
+DigitalOut  red_led(D7);
+DigitalOut  yellow_led(D6);
+DigitalOut  green_led(D5);
+DigitalIn   SW1(D4);
+
+int main() {
+
+    //Switch on Yellow and Green to indicate
+    //that the code is running
+    yellow_led = 1;
+    green_led = 1;
+    red_led = 0; //Set RED LED to OFF
+    
+    // Wait for SW1 to be pressed
+    while (SW1 == 0) { }
+    
+    red_led = 1;    //Turn ON LED
+    
+    while (1) { }       //Repeat forever
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Sep 24 12:25:21 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/bad568076d81
\ No newline at end of file