![]() |
MD_MSGEQ7 IC Arduino Library 1.2
Library to control MSGEQ7 Seven Band Graphic Equalizer IC
|
#include <MD_MSGEQ7.h>
Public Member Functions | |
| MD_MSGEQ7 (uint8_t resetPin, uint8_t strobePin, uint8_t dataPin, uint32_t readDelay) | |
| ~MD_MSGEQ7 (void) | |
| void | begin (void) |
Methods for object and hardware control. | |
| void | reset (void) |
| bool | read (bool bReset=true) |
| uint16_t | get (uint8_t band) |
Static Public Attributes | |
| static const uint8_t | MAX_BAND = 7 |
| Number of bands output by the hardware IC. | |
Core object for the MD_MSGEQ7 library
| MD_MSGEQ7::MD_MSGEQ7 | ( | uint8_t | resetPin, |
| uint8_t | strobePin, | ||
| uint8_t | dataPin, | ||
| uint32_t | readDelay ) |
Class Constructor - arbitrary digital interface with delay.
Instantiate a new instance of the class. The parameters passed are used to connect the software to the hardware. Multiple instances may co-exist.
The delay parameter causes the library to read the device no more frequently that every readDelay milliseconds. This relieves the calling application from managing timers to control reqd() frequency
| resetPin | Arduino output pin for IC reset. |
| strobePin | Arduino output for strobing the device during read. |
| dataPin | Arduino input where data gets read from the IC. |
| readDelay | milliseconds delay between device reads. |
| MD_MSGEQ7::~MD_MSGEQ7 | ( | void | ) |
Class Destructor.
Does the necessary to clean up once the object is no longer required.
| void MD_MSGEQ7::begin | ( | void | ) |
Initialize the object.
Initialize the object data. This needs to be called during setup() to initialize new data for the class that cannot be done during the object creation.
| uint16_t MD_MSGEQ7::get | ( | uint8_t | band | ) |
Get a specific value from the data read.
Read data elements from the device buffer filled by a previous read() call. The elements referenced are numbered 0..MAX_BAND-1 for IC values centered around the 63Hz, 160Hz, 400Hz, 1KHz, 2.5KHz, 6.25KHz and 16kHz bands respectively.
| band | index of the data point requested [0..MAX_BAND-1]. |
| bool MD_MSGEQ7::read | ( | bool | bReset = true | ) |
Read the next set of data from the IC.
Read a full set of MAX_BAND values from the IC. The optional parameter is used to suppress a reset before the read - default is to reset.
The readDelay passed into the constructor is used to set the minimum read() frequency. The method returns false if the timer has not expired.
| bReset | enables a device reset prior to read if true, disables if false. |
| void MD_MSGEQ7::reset | ( | void | ) |
Reset the IC before initiating a read.