This library sets up and LED volume indication function and reading values from the Electret Microphone - MAX4466 Amplifier
Dependents: MAX4466_Hello_World
Diff: MAX4466.h
- Revision:
- 0:712373b300a2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MAX4466.h Fri Oct 23 18:37:33 2015 +0000 @@ -0,0 +1,32 @@ +#ifndef MBED_MIC_H +#define MBED_MIC_H + +#include "mbed.h" + +class MAX4466 { + +public: + + MAX4466(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; + float _sum; + float _average; + int _count; + float _sample; + Timer _t; + Timer _t1; +}; + +#endif \ No newline at end of file