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.
Diff: main.cpp
- Revision:
- 26:5076b996d5a9
- Parent:
- 25:7dad1f41744f
--- a/main.cpp Sat Apr 11 05:02:32 2020 +0000 +++ b/main.cpp Sun Apr 12 04:38:16 2020 +0000 @@ -1,39 +1,17 @@ -#include "mbed.h" -#include "iostream" - -using namespace std; +#include "mbed.h" +DigitalOut led(LED2); +DigitalIn push1(SW2); +DigitalIn push2(SW3); Serial com1(USBTX,USBRX); // PARA USAR LOS PINES UART - -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; +int main() +{ + + while(push1==1 || push2==1){ + led=1; + com1.printf("El led esta encendido \n"); + } + + } - return 0; - - } + \ No newline at end of file