![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Este programa lee 2 señales analogas y las grafica utilizando app inventor
Revision 0:255022cab6ef, committed 2017-11-26
- Comitter:
- caapalacioto
- Date:
- Sun Nov 26 23:03:32 2017 +0000
- Commit message:
- lee 2 se?ales analogas.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Nov 26 23:03:32 2017 +0000 @@ -0,0 +1,37 @@ + +#include "mbed.h" +#include <stdio.h> +#include <string.h> + +//#include <conio.h> +DigitalOut LedVerde(LED2); +DigitalOut LedRojo(LED1); +DigitalOut LedAzul(LED3); + +Serial GSM(PTE0,PTE1); //puertos del FRDM para el modem +Serial pc(USBTX,USBRX); +int num1, num2, i1,i2,j1,j2,k1,k2; +char med[3]; +AnalogIn input1(PTC1); //Canal 1 +AnalogIn input2(PTC2); //Canal 2 + +int main(void) +{ + pc.baud(9600); // asigno baudios y configuro puerto serie + pc.format(8,Serial::None,1); + GSM.baud(9600); // asigno baudios y configuro puerto serie de la usart + GSM.format(8,Serial::None,1); + while(1) { + //leo puerto analogico canal 1 + wait(0.5); + num1 = input1*1000; //agrando el numero de cero a mil + + //leo puerto analogico canal 2 + wait(0.5); + num2 = input2*1000; //agrando el numero de cero a mil + wait(0.5); + pc.printf("%i, %i ", num1, num2); + GSM.printf("%i, %i, ", num1, num2); + } +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Nov 26 23:03:32 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/b484a57bc302 \ No newline at end of file