6 years, 6 months 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(); }

  1. else DEVICE_I2S

int main(void) { printf("The target does not support I2S API.\r\n"); }

  1. endif DEVICE_I2S
Be the first to answer this question.