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

Revision:
1:380e6ab41172
Parent:
0:d096ca2ffef0
--- a/Hammer_MicrophoneSensor.h	Sun Nov 02 17:00:16 2014 +0000
+++ b/Hammer_MicrophoneSensor.h	Sun Nov 02 17:12:22 2014 +0000
@@ -1,27 +1,29 @@
-//#ifndef MBED_MIC_H
-//#define MBED_MIC_H
-//
-//#include "mbed.h"
-//
-//class MAX9814 {
-//    
-//public:
-//
-//    MAX9814(PinName pin);
-//    
-//    void led_array(float x);
-//    
-//    float calibration();
-//    
-//    float sound_level();
-//
-//protected:
-//    AnalogIn _pin;
-//    BusOut _led1, _led2, _led3, _led4;
-//    float _value,_sum,_average;
-//    int _count;
-//    float _sample;
-//    Timer _t,_t1;
-//};
-//
-//#endif
\ No newline at end of file
+#ifndef MBED_MIC_H
+#define MBED_MIC_H
+
+#include "mbed.h"
+
+class MAX9814 {
+    
+public:
+
+    MAX9814(PinName pin);
+    
+    void led_array(float x);
+    
+    void volume_indicator();
+    
+    float calibration();
+    
+    float sound_level();
+
+protected:
+    AnalogIn _pin;
+    BusOut _led1, _led2, _led3, _led4;
+    float _value,_sum,_average;
+    int _count;
+    float _sample;
+    Timer _t,_t1;
+};
+
+#endif
\ No newline at end of file