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.
main.cpp
00001 #include "mbed.h" //librería que nos permite utilizar comandos y sentencias propias de mbed 00002 Serial com1(USBTX, USBRX); 00003 DigitalOut rojo(LED1); 00004 DigitalOut verde(LED2); 00005 DigitalOut azul(LED3); 00006 00007 void luz_alto() { 00008 rojo = 0; 00009 verde = 1; 00010 azul = 1; 00011 wait(5); 00012 } 00013 00014 void luz_preventivo() { 00015 rojo = 0; 00016 verde = 0; 00017 azul = 1; 00018 wait(1); 00019 } 00020 00021 void luz_siga() { 00022 rojo = 1; 00023 verde = 0; 00024 azul = 1; 00025 wait(3); 00026 } 00027 00028 void parpadear_luz(DigitalOut luz) { 00029 for(int i=0; i<4; i++) { 00030 luz = 1; 00031 wait(0.2); 00032 } 00033 } 00034 00035 int main() { 00036 00037 while(true) 00038 { 00039 luz_alto(); 00040 parpadear_luz(rojo); 00041 luz_preventivo(); 00042 luz_siga(); 00043 parpadear_luz(verde); 00044 } 00045 00046 }
Generated on Sat Sep 24 2022 06:06:53 by
