MAX4466 with ability to take instananeous level of mic

Dependents:   4180_Tuner

MAX4466.h

Committer:
collinrusch
Date:
2019-04-28
Revision:
2:0090c008b13e
Parent:
0:712373b300a2

File content as of revision 2:0090c008b13e:

#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();
    float instantlevel();

protected:
    AnalogIn    _pin;
    BusOut      _led1, _led2, _led3, _led4;
    float       _value;
    float       _sum;
    float       _average;
    int         _count;
    float       _sample;
    Timer       _t;
    Timer       _t1;
};

#endif