p4e2

Dependencies:   mbed

Files at this revision

API Documentation at this revision

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
diff -r 000000000000 -r f39a784a10dc main.cpp
--- /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
diff -r 000000000000 -r f39a784a10dc mbed.bld
--- /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