MD_MSGEQ7 IC Arduino Library 1.2
Library to control MSGEQ7 Seven Band Graphic Equalizer IC
Loading...
Searching...
No Matches
MD_MSGEQ7 Class Reference

#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.
 

Detailed Description

Core object for the MD_MSGEQ7 library

Constructor & Destructor Documentation

◆ MD_MSGEQ7()

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

See also
read()
Parameters
resetPinArduino output pin for IC reset.
strobePinArduino output for strobing the device during read.
dataPinArduino input where data gets read from the IC.
readDelaymilliseconds delay between device reads.

◆ ~MD_MSGEQ7()

MD_MSGEQ7::~MD_MSGEQ7 ( void )

Class Destructor.

Does the necessary to clean up once the object is no longer required.

Member Function Documentation

◆ begin()

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.

◆ get()

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.

Parameters
bandindex of the data point requested [0..MAX_BAND-1].
Returns
The value requested from the buffer.

◆ read()

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.

See also
get()
Parameters
bResetenables a device reset prior to read if true, disables if false.
Returns
true if read was executed and data is available.

◆ reset()

void MD_MSGEQ7::reset ( void )

Reset the IC before initiating a read.


The documentation for this class was generated from the following files: