Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
How do I get the mic input to output to the speaker analog output, also not to sure about how to set the buffer, I want to set a buffer without a limit, and then have the mic continuously output to the speaker like a karaoke or headphone mic monitor
#include "mbed.h" AnalogIn input(p20); DigitalOut led1(LED1); AnalogOut speaker(p18); int main() { unsigned short samples[1024]; for(int i=0; i<1024; i++) { samples[i] = input.read_u16(); wait_ms(1); } printf("Results:\n"); for(int i=0; i<1024; i++) { printf("%d, 0x%04X\n", i, samples[i]); speaker.write_u16(samples[i]); } }