Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 26:22f3f938cd2f, committed 2020-04-24
- Comitter:
- nervy
- Date:
- Fri Apr 24 22:46:41 2020 +0000
- Parent:
- 25:ec72507ea71b
- Commit message:
- x
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r ec72507ea71b -r 22f3f938cd2f main.cpp --- a/main.cpp Sun Apr 12 03:56:57 2020 +0000 +++ b/main.cpp Fri Apr 24 22:46:41 2020 +0000 @@ -1,27 +1,27 @@ #include "mbed.h" //librería que nos permite utilizar comandos y sentencias propias de mbed - -DigitalOut alto(LED1); -DigitalOut prev(LED2); -DigitalOut siga(LED3); +Serial com1(USBTX, USBRX); +DigitalOut rojo(LED1); +DigitalOut verde(LED2); +DigitalOut azul(LED3); void luz_alto() { - alto = 1; - prev = 0; - siga = 0; + rojo = 0; + verde = 1; + azul = 1; wait(5); } void luz_preventivo() { - alto = 0; - prev = 1; - siga = 0; + rojo = 0; + verde = 0; + azul = 1; wait(1); } void luz_siga() { - alto = 0; - prev = 0; - siga = 1; + rojo = 1; + verde = 0; + azul = 1; wait(3); } @@ -37,10 +37,10 @@ while(true) { luz_alto(); - parpadear_luz(alto); + parpadear_luz(rojo); luz_preventivo(); luz_siga(); - parpadear_luz(siga); + parpadear_luz(verde); } } \ No newline at end of file