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 27:681516f418e5, committed 2020-04-12
- Comitter:
- montse
- Date:
- Sun Apr 12 02:49:53 2020 +0000
- Parent:
- 26:0abd50bf69ae
- Commit message:
- Ejercicio 3 correspondiente a la practica 5.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Apr 11 20:25:47 2020 +0000 +++ b/main.cpp Sun Apr 12 02:49:53 2020 +0000 @@ -4,30 +4,32 @@ presionado o botón no presionado. (Utilizar una función con argumentos y sin retorno de valor)*/ Serial com1(USBTX, USBRX); - +DigitalIn boton1(PTC6); void Boton(int Si, int No) { int pulsado; - + int sinpulsar; pulsado = Si; - - com1.printf("El boton esta pulsado \n", pulsado); - - - int sinpulsar; - sinpulsar = No; + if(Si==1) + { + com1.printf("El boton esta pulsado \n", pulsado); + } + + else + { com1.printf("El boton no esta pulsado \n", sinpulsar); - + } + } - + int main () { int e1,e2; - e1 = 0; + e1 = boton1; e2 = !e1; Boton(e1,e2);