Christopher Wardlaw / Mbed 2 deprecated ME21001_Lab02_Exercise_04

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
cwardlaw
Date:
Sat Sep 24 14:57:19 2016 +0000
Commit message:
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	Sat Sep 24 14:57:19 2016 +0000
@@ -0,0 +1,27 @@
+/**************************************************************
+/ Simple program program to show basic program structure
+/
+/ The program flashes attached LEDs for 1 second sequentially and repeats indeffinitely.
+/
+/**************************************************************/
+
+#include "mbed.h"
+
+DigitalOut yelLED(p22); // name attached LED p22
+DigitalOut greLED(p23); // name attached LED p23
+DigitalOut redLED(p24); // name attached LED p24
+int main() {
+  while(1) { // repeat indefinitely
+    yelLED = 1; // activates yellow LED
+    wait(1); // pauses for a second
+    yelLED = 0; // deactivates yellow LED
+    wait(1); // pauses for a second
+    greLED = 1; // activates green LED
+    wait(1); // pauses for a second
+    greLED = 0; // deactivates green LED
+    wait(1); // pauses for a second
+    redLED = 1; // activates red LED
+    wait(1); // pauses for a second
+    redLED = 0; // deactivates red LED
+  }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Sep 24 14:57:19 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/abea610beb85
\ No newline at end of file