yutong look here
Dependencies: FastAnalogIn fastADC
Diff: main.cpp
- Revision:
- 109:1d95a4596fb5
- Parent:
- 103:2da5fc276330
- Child:
- 110:037667235b6d
--- a/main.cpp Mon Nov 25 02:27:34 2019 +0000 +++ b/main.cpp Mon Nov 25 02:56:01 2019 +0000 @@ -8,6 +8,7 @@ #include "stats_report.h" #include <AnalogIn.h> #include <AnalogOut.h> +#include "circ_buff.hpp" AnalogOut v_src(GPIO0); AnalogIn therm(GPIO2); @@ -17,28 +18,32 @@ #include "mbed.h" -DigitalOut led1(LED1); -DigitalOut led2(LED2); -Thread thread1; -Thread thread2; +//DigitalOut led1(LED1); +//DigitalOut led2(LED2); +Thread thread_adc; + +Thread thread_mfcc; -void led1_thread() { +void adc_thread() { while (true) { - led1 = !led1; - wait(0.5); - printf("Printing from thread #%d", 1); + printf("Top of ADC sampling thread"); + + wait(0.6); } } -void led2_thread() { +/* + this thread is in charge of converting +*/ +void mfcc_thread() { while (true) { - led2 = !led2; - wait(1); - printf("Printing from thread #%d", 2); + printf("Top of MFCC thread"); + + wait(2); } } int main() { - thread1.start(led1_thread); - thread2.start(led2_thread); + thread_adc.start(adc_thread); + thread_mfcc.start(mfcc_thread); } \ No newline at end of file