Program to control Electret Microphone Amplifier - MAX9814 from adafruit. Allows: To sample analogue voltage to transform into rough sound level. Transfer sound level to visual indicator, volume bar such as 4 LEDs on LPC11U24.

Dependencies:   MAX9814_Electret_Microphone_LED_Volume_Indicator mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "MAX9814.h"
00003 Serial pc (USBTX, USBRX);
00004 
00005 
00006 MAX9814 mic(p20);
00007 
00008 int main()
00009 {
00010     while (1) {
00011         mic.volume_indicator();
00012         pc.printf("\n\r Level is %f", mic.sound_level());
00013     }
00014 }