sharon look here
Dependencies: fastADC
Revision 10:4f5f29aa87a3, committed 2019-12-08
- Comitter:
- guoxsharon
- Date:
- Sun Dec 08 07:33:42 2019 +0000
- Parent:
- 9:7bc1efc28246
- Commit message:
- serial pc added
Changed in this revision
src/main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 7bc1efc28246 -r 4f5f29aa87a3 src/main.cpp --- a/src/main.cpp Sun Dec 08 07:25:45 2019 +0000 +++ b/src/main.cpp Sun Dec 08 07:33:42 2019 +0000 @@ -14,6 +14,7 @@ // PIN DEFINITIONS DigitalOut vcc(GPIO0); AnalogIn mic(PB_0); +Serial pc(UART_TX, UART_RX, 115200); // To sleep, 'wait' should be replaced by 'ThisThread::sleep_for' (C++) or 'thread_sleep_for' (C). If you wish to wait (without sleeping), call 'wait_us'. 'wait_us' is safe to call from ISR context. [since mbed-os-5.14] [-Wdeprecated-declarations] in "main.cpp", Line: 59, Col: 9 @@ -23,7 +24,7 @@ vcc = 1; uint16_t raw_vals[ARR_SIZE]; int i = 0; - printf("Loading values...\n"); + //pc.printf("Loading values...\n"); while(1) { memset(raw_vals, 0, ARR_SIZE * sizeof(uint16_t)); i = 0; @@ -35,7 +36,7 @@ wait(1); i = 0; for(i; i < ARR_SIZE; i++) { - printf("%u,", raw_vals[i]); + pc.printf("%u,", raw_vals[i]); } while(1);