Gerardo Carmona
/
06_Semaforo_Peatonal
Stop Light for pedestrians
Revision 0:08fa190dfc38, committed 2013-10-09
- Comitter:
- gcarmonar
- Date:
- Wed Oct 09 21:26:01 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 |
diff -r 000000000000 -r 08fa190dfc38 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Oct 09 21:26:01 2013 +0000 @@ -0,0 +1,40 @@ +#include "mbed.h" + +DigitalOut cr(D3); +DigitalOut ca(D4); +DigitalOut cv(D5); + +DigitalOut pr(D6); +DigitalOut pv(D7); + +DigitalIn boton(D2); + +int bvalue = 1; + + +int main() { + boton.mode(PullUp); + while(1) { + while(bvalue == 1){ + cv = 1; + pr = 1; + bvalue = boton; + } + + for (int i = 0; i < 3; i++){ + cv = 1; + wait(0.5); + cv = 0; + wait(0.5); + } + ca = 1; + wait(1); + ca = 0; + cr = 1; + pr = 0; + pv = 1; + wait(3); + pv = 0; + cr = 0; + } +}
diff -r 000000000000 -r 08fa190dfc38 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Oct 09 21:26:01 2013 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f \ No newline at end of file