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
Hammer_MicrophoneSensor.h@0:d096ca2ffef0, 2014-11-02 (annotated)
- Committer:
- andcor02
- Date:
- Sun Nov 02 17:00:16 2014 +0000
- Revision:
- 0:d096ca2ffef0
- Child:
- 1:380e6ab41172
Made into class system, not into seperate h or c though.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| andcor02 | 0:d096ca2ffef0 | 1 | //#ifndef MBED_MIC_H |
| andcor02 | 0:d096ca2ffef0 | 2 | //#define MBED_MIC_H |
| andcor02 | 0:d096ca2ffef0 | 3 | // |
| andcor02 | 0:d096ca2ffef0 | 4 | //#include "mbed.h" |
| andcor02 | 0:d096ca2ffef0 | 5 | // |
| andcor02 | 0:d096ca2ffef0 | 6 | //class MAX9814 { |
| andcor02 | 0:d096ca2ffef0 | 7 | // |
| andcor02 | 0:d096ca2ffef0 | 8 | //public: |
| andcor02 | 0:d096ca2ffef0 | 9 | // |
| andcor02 | 0:d096ca2ffef0 | 10 | // MAX9814(PinName pin); |
| andcor02 | 0:d096ca2ffef0 | 11 | // |
| andcor02 | 0:d096ca2ffef0 | 12 | // void led_array(float x); |
| andcor02 | 0:d096ca2ffef0 | 13 | // |
| andcor02 | 0:d096ca2ffef0 | 14 | // float calibration(); |
| andcor02 | 0:d096ca2ffef0 | 15 | // |
| andcor02 | 0:d096ca2ffef0 | 16 | // float sound_level(); |
| andcor02 | 0:d096ca2ffef0 | 17 | // |
| andcor02 | 0:d096ca2ffef0 | 18 | //protected: |
| andcor02 | 0:d096ca2ffef0 | 19 | // AnalogIn _pin; |
| andcor02 | 0:d096ca2ffef0 | 20 | // BusOut _led1, _led2, _led3, _led4; |
| andcor02 | 0:d096ca2ffef0 | 21 | // float _value,_sum,_average; |
| andcor02 | 0:d096ca2ffef0 | 22 | // int _count; |
| andcor02 | 0:d096ca2ffef0 | 23 | // float _sample; |
| andcor02 | 0:d096ca2ffef0 | 24 | // Timer _t,_t1; |
| andcor02 | 0:d096ca2ffef0 | 25 | //}; |
| andcor02 | 0:d096ca2ffef0 | 26 | // |
| andcor02 | 0:d096ca2ffef0 | 27 | //#endif |
Andrea Corrado
Electret Microphone Amplifier - MAX9814