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 0:da682e9c8855, committed 2020-11-12
- Comitter:
- dnluna_
- Date:
- Thu Nov 12 07:08:53 2020 +0000
- Commit message:
- use for;
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FXOS8700Q.lib Thu Nov 12 07:08:53 2020 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/teams/Freescale/code/FXOS8700Q/#aee7dea904e2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Nov 12 07:08:53 2020 +0000 @@ -0,0 +1,43 @@ +#include "mbed.h" //P4E5 +Serial comunication(USBTX, USBRX); +DigitalIn boton(p13); +//Estructura de control repititiva para envir las suma de cinco números consecutivos cada vez que se presione un botóndebe enviar nuevamente la suma +// y al presionarlo debe enviar nuevamente enviar la suma de cinco numero consecutivos: UTILIZAR for +int main() + { + int contador2=0; + + while(1) + { + if (boton==1) + { + int x=x+1, y=x+4, suma=0; + if(x==1) + { + for(int contador=x;contador<=y;contador++) + { + suma=suma+contador; + } + comunication.printf("Resultado= %d\n", suma); + } + + else + { + int n=n+6, m=n+4; + for(int contador=n; contador<=m; contador++) + { + suma=suma+contador; + } + contador2++; + if(contador2>=2) + { + suma=suma-(5*(contador2-1)); + } + comunication.printf("%d\n", contador2); + comunication.printf("Respuesta: %d\n",suma); + } + } + +wait(1); +} +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Nov 12 07:08:53 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file