Procesadores 2017
/
APP_ANALOGA
grafica dos variables analogas
Revision 0:0c4432f82bda, committed 2017-11-30
- Comitter:
- PROCESADORES_2017_2
- Date:
- Thu Nov 30 20:18:21 2017 +0000
- Commit message:
- grafica dos variables 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 Thu Nov 30 20:18:21 2017 +0000 @@ -0,0 +1,34 @@ + +#include "mbed.h" +#include <stdio.h> +#include <string.h> + + + + +Serial BT(PTE0,PTE1); //puertos del FRDM para el modem + +int num, num2, i,i2,j,j2,k,k2; +char med[3]; + +AnalogIn P1(PTB1); //Canal 1 +AnalogIn P2(PTB0); //Canal 2 + +int main(void) +{ + + BT.baud(9600); // asigno baudios y configuro puerto serie de la usart + BT.format(8,Serial::None,1); + while(1) { + //leo puerto analogico canal 1 + wait(0.5); + num = P1*1000; //agrando el numero de cero a mil + + //leo puerto analogico canal 2 + wait(0.5); + num2 = P2*1000; //agrando el numero de cero a mil + wait(0.5); + BT.printf("%i, %i ", num, num2); + + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Nov 30 20:18:21 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/e7ca05fa8600 \ No newline at end of file