![]() |
MD_MSGEQ7 IC Arduino Library
1.0
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) | |
~MD_MSGEQ7 (void) | |
void | begin (void) |
Methods for object and hardware control. | |
void | reset (void) |
void | read (bool bReset=true) |
uint8_t | get (uint8_t band) |
Core object for the MD_MSGEQ7 library
MD_MSGEQ7::MD_MSGEQ7 | ( | uint8_t | resetPin, |
uint8_t | strobePin, | ||
uint8_t | dataPin | ||
) |
Class Constructor - arbitrary digital interface.
Instantiate a new instance of the class. The parameters passed are used to connect the software to the hardware. Multiple instances may co-exist.
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. |
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.
Initialise the object data. This needs to be called during setup() to initialise new data for the class that cannot be done during the object creation.
uint8_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]. |
void 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.
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.