Stop light example using 3 leds

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
gcarmonar
Date:
Wed Oct 09 21:10:46 2013 +0000
Commit message:
Ver1.0

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	Wed Oct 09 21:10:46 2013 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+
+DigitalOut rojo(PTA1);
+DigitalOut amarillo(PTA2);
+DigitalOut verde(PTD4);
+
+int main() {
+    while(1) {
+        verde = 1;
+        wait(3);
+        for(int i = 10; i <= 12; i++){
+            verde = 1;
+            wait(0.5);
+            verde = 0;
+            wait(0.5);
+        }
+        
+        amarillo = 1;
+        wait(1);
+        amarillo = 0;
+        rojo = 1;
+        wait(3);
+        rojo = 0;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Oct 09 21:10:46 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f
\ No newline at end of file