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.
7 years, 1 month ago.
How to detect Sound using STM32-NUCLEO-F401RE and expansion board x-NUCLEO-CCA02M1
I am using STM32-NUCLEO-F401RE MCU and expansion board x-NUCLEO-CCA02M1 for detection of sound from Mic 1 of x-NUCLEO-CCA02M1 with timer value (clock) and blink of LED Light. Please guide me with program.
thanks in advance.
int main(void)
{
/*- Initialization. -*/
/* Initializing MEMS Microphones Expansion Board on the I2S1 interface. */ XNucleoCCA02M1 *microphones = new XNucleoCCA02M1(PB_15, PB_13); if (microphones->init(&init) != COMPONENT_OK) { error("Initialization of the MEMS Microphones Expansion Board failed.\r\n"); exit(EXIT_FAILURE); }
/* Enabling transmission via USB. */ microphones->enable_usb();
/* Printing to the console. */ printf("MEMS Microphones Application Example\r\n\n"); DigitalOut myled(LED1); myled = 1; wait(0.8); 200 ms myled = 0;
/*- Recording. -*/
/* Printing to the console. */
printf("> Recording...\r\n");
microphones->record();
/* Dispatching forever the I2S queue. */ I2S::i2s_bh_queue.dispatch_forever(); }
- else DEVICE_I2S
int main(void) { printf("The target does not support I2S API.\r\n"); }
- endif DEVICE_I2S