Procesadores 2017
/
APP_ANALOGA
grafica dos variables analogas
Diff: main.cpp
- Revision:
- 0:0c4432f82bda
diff -r 000000000000 -r 0c4432f82bda main.cpp --- /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); + + } +}