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 25:7dad1f41744f, committed 2020-04-11
- Comitter:
- cielo
- Date:
- Sat Apr 11 05:02:32 2020 +0000
- Parent:
- 24:7f14b70fc9ef
- Commit message:
- practica 4 ejercicio 4
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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