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:
- 25:32acf45398b4
- Parent:
- 24:7f14b70fc9ef
- Child:
- 26:c1f837b137f8
--- a/main.cpp Mon Apr 08 11:03:25 2019 +0100 +++ b/main.cpp Sat Apr 11 11:00:23 2020 +0000 @@ -1,12 +1,33 @@ -#include "mbed.h" +#include "mbed.h" //libreria que nos permite utilizar comandos y sentencias propias de mbed +#include <iostream> -DigitalOut myled(LED1); +//Mediante el uso del condicional if implementar un programa que permita imprimir diferentes mensajes cuando se presionan al menos tres diferentes teclas. + +Serial com1(USBTX, USBRX); + +using namespace std; -int main() { - while(1) { - myled = 1; - wait(0.2); - myled = 0; - wait(0.2); - } +int main() +{ + int tecla; + com1.printf("Cuantas veces al dia te lavas las manos? \n\n"); +if ((tecla <= 9)&&(tecla >= 3)){ + com1.printf("Eso es genial. \n"); + + com1.printf("Que mas personas sean responsables como tu :) \n\n"); } + +if (tecla <3){ + com1.printf("Eso es triste :( \n"); + + com1.printf("Hazlo mas seguido y no olvides usar gel antibacterial. \n\n"); +} + +if (tecla >=10){ + com1.printf("Vaya! Tu si que te cuidas. \n"); + +} + +com1.printf("Recuerda, Si te cuidas tu, nos cuidamos todos"); +} +