Isaac Cruz
/
Practica_4_-_Ejercicio_02
p4e2
Revision 0:f39a784a10dc, committed 2019-10-16
- Comitter:
- isaacross99
- Date:
- Wed Oct 16 00:37:56 2019 +0000
- Commit message:
- p4e2
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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Oct 16 00:37:56 2019 +0000 @@ -0,0 +1,25 @@ +#include "mbed.h" +DigitalOut Blue(LED3); +DigitalOut Red(LED1); +Serial pc(USBTX,USBRX); +void condicion(char Tecla){ + if(Tecla=='D' || Tecla=='d'){ + Red=!Red; + pc.printf("D es la letra magica."); + } + else + pc.printf("%s", Tecla); +} + +int main(){ + Blue=1; + Red=0; + char Tecla; + pc.printf("La tecla presionada es: \r\n"); + while(1){ + Blue=0; + Tecla=pc.getc(); + condicion(Tecla); + Tecla=NULL; + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Oct 16 00:37:56 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file