Cielo Benítez / Mbed 2 deprecated prac4_ejer7

Dependencies:   mbed

Revision:
25:7dad1f41744f
Parent:
24:7f14b70fc9ef
Child:
26:5076b996d5a9
--- a/main.cpp	Mon Apr 08 11:03:25 2019 +0100
+++ b/main.cpp	Sat Apr 11 05:02:32 2020 +0000
@@ -1,12 +1,39 @@
-#include "mbed.h"
+#include  "mbed.h"   
+#include "iostream"
 
-DigitalOut myled(LED1);
+using namespace std;
+Serial com1(USBTX,USBRX); // PARA USAR LOS PINES UART
 
-int main() {
-    while(1) {
-        myled = 1;
-        wait(0.2);
-        myled = 0;
-        wait(0.2);
+int main(){
+    char n;
+    com1.printf("Digite un numero entre 0-9: ");
+    scanf(" %c",&n);
+    switch(n){
+        case 48:printf("Es el numero 0");
+        break;
+        case 49:printf("Es el numero 1");
+        break;
+        case 50:printf("Es el numero 2");
+        break;
+        case 51:printf("Es el numero 3");
+        break;
+        case 52:printf("Es el numero 4");
+        break;
+        case 53:printf("Es el numero 5");
+        break;
+        case 54:printf("Es el numero 6");
+        break;
+        case 55:printf("Es el numero 7");
+        break;
+        case 56:printf("Es el numero 8");
+        break;
+        case 57:printf("Es el numero 9");
+        break;
+        default: 
+        com1.printf("No se encuetra entre los numeros 0-9");
+        break;
+        }
+    return 0;
+
     }
-}
+       
\ No newline at end of file