![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Proyecto que lee un buffer de la entrada y lo manda por el serial
Diff: main.cpp
- Revision:
- 1:1895d2877fef
- Parent:
- 0:d8bdd80b93fe
diff -r d8bdd80b93fe -r 1895d2877fef main.cpp --- a/main.cpp Tue Oct 15 14:21:57 2019 +0000 +++ b/main.cpp Tue Oct 15 15:09:15 2019 +0000 @@ -1,6 +1,8 @@ #include "mbed.h" #define bufferLength 256 +Serial pc(USBTX, USBRX,115200); // tx, rx + AnalogIn analog_value(A0); Ticker tMuestrea; int flag=0; @@ -10,16 +12,17 @@ int main() { + tMuestrea.attach(&muestrea, 0.001); printf("\nAnalogIn example\n"); while(1) { if (flag) { for (int n=0; n<bufferLength; n++) { - printf("%d\n",buffer[n]); + pc.printf("%d\n",buffer[n]); } flag=0; } - wait(1); + wait_us(1); } }