Gerardo Carmona
/
MSE_Semaforo_Peatonal
Stop light for pedestrians
Diff: main.cpp
- Revision:
- 0:12ef4957674a
--- /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 + +