Stop light for pedestrians

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
gcarmonar
Date:
Mon Nov 24 23:08:56 2014 +0000
Commit message:
Stop light for pedestrians

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	Mon Nov 24 23:08:56 2014 +0000
@@ -0,0 +1,33 @@
+#include "mbed.h"
+
+DigitalOut c_verde(D0);
+DigitalOut c_amarillo(D1);
+DigitalOut c_rojo(D2);
+DigitalOut p_rojo(D3);
+DigitalOut p_verde(D4);
+DigitalIn boton(D5);
+
+int main()
+{
+    while (true) {
+        c_verde = 1;
+        p_rojo = 1;
+        if (boton){
+            for (int i = 0; i < 3; i++){
+                c_verde = 1;
+                wait(0.5);
+                c_verde = 0;
+                wait(0.5);
+            }
+            c_amarillo = 1;
+            wait(1);
+            c_amarillo = 0;
+            c_rojo = 1;
+            p_verde = 1;
+            p_rojo = 0;
+            wait(6);
+        } // if
+    } // while
+} // main
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Nov 24 23:08:56 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/031413cf7a89
\ No newline at end of file