Gerardo Carmona
/
05_Semaforo
Stop light example using 3 leds
Revision 0:64a4346303b5, committed 2013-10-09
- 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 |
diff -r 000000000000 -r 64a4346303b5 main.cpp --- /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; + } +}
diff -r 000000000000 -r 64a4346303b5 mbed.bld --- /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