Skip to content

MSGEQ7 Library Documentation

EngineeredEntropy edited this page Mar 22, 2013 · 1 revision

Description

MSGEQ7 Library for Arduino

This Library interfaces with an MSGEQ7 Graphic Equalizer IC. Timings have been matched to the minimum requirements in the datasheet. This version may currently only function on a 16MHz Arduino. Version: 0.1

Dependencies

Functions


MSGEQ7(int reset, int strobe, int output)

Description

Instantiates an MSGEQ7 object attatched to the provided pin numbers.

Arguements

  • reset Arduino pin connected to the MSGEQ7 RESET input.
  • strobe Arduino pin connected to the MSGEQ7 STROBE input.
  • output Arduino analog pin connected to the MSGEQ7 OUTPUT signal.

Returns


void reset()

Description

Sends a reset pulse to the MSGEQ7.

Arguements

Returns


void strobe()

Description

Sends a strobe pulse to the MSGEQ7.

Arguements

Returns


void correctOffset(bool correct)

Description

Sets the correctOffset Flag. If the flag is true the DC Offset will be subtracted from the readings.

Arguements

  • correct The correctOffset flag value.

Returns


bool detectOffset()

Description

Cycles through all MSGEQ7 outputs and averages the DC value. This function should only be run when there is no audio input to the MSGEQ7.

Arguements

Returns


bool setOffset(int offset)

Description

Manually sets the offset value.

Arguements

  • offset The offset value.

Returns


int getOffset()

Description

Returns the current offset value.

Arguements

Returns

  • int The offset value.

void readAll()

Description

Reads the analog values of all MSGEQ7 frequency bands and stores them to internal variables.

Arguements

Returns

  • int The offset value.

int read()

Description

Reads the current analog values of the MSGEQ7 output. This value is not stored to an internal variable and will be scaled if the correctOffset flag is set.

Arguements

Returns

  • int The analog reading from 0-1024.

int read63()

Description

Reads the analog value of the MSGEQ7 output at 63Hz. This value is stored to its internal variable and will be scaled if the correctOffset flag is set.

Arguements

Returns

  • int The analog reading at 63Hz from 0-1024.

int read160()

Description

Reads the analog value of the MSGEQ7 output at 160Hz. This value is stored to its internal variable and will be scaled if the correctOffset flag is set.

Arguements

Returns

  • int The analog reading at 160Hz from 0-1024.

int read400()

Description

Reads the analog value of the MSGEQ7 output at 400Hz. This value is stored to its internal variable and will be scaled if the correctOffset flag is set.

Arguements

Returns

  • int The analog reading at 400Hz from 0-1024.

int read1000()

Description

Reads the analog value of the MSGEQ7 output at 1kHz. This value is stored to its internal variable and will be scaled if the correctOffset flag is set.

Arguements

Returns

  • int The analog reading at 1kHz from 0-1024.

int read2500()

Description

Reads the analog value of the MSGEQ7 output at 2.5kHz. This value is stored to its internal variable and will be scaled if the correctOffset flag is set.

Arguements

Returns

  • int The analog reading at 2.5kHz from 0-1024.

int read6250()

Description

Reads the analog value of the MSGEQ7 output at 6.25kHz. This value is stored to its internal variable and will be scaled if the correctOffset flag is set.

Arguements

Returns

  • int The analog reading at 6.25kHz from 0-1024.

int read16000()

Description

Reads the analog value of the MSGEQ7 output at 16kHz. This value is stored to its internal variable and will be scaled if the correctOffset flag is set.

Arguements

Returns

  • int The analog reading at 16kHz from 0-1024.

int getValue(int index)

Description

Returns the analog value of the MSGEQ7 output at 63Hz. This value is read from its internal variable and will be scaled if the correctOffset flag is set.

Arguements

  • index The index of the frequency to be read from 0 to 6 (63Hz to 16kHz).

Returns

  • int The analog reading at the specified index from 0-1024.

int get63()

Description

Returns the analog value of the MSGEQ7 output at 63Hz. This value is read from its internal variable and will be scaled if the correctOffset flag is set.

Arguements

Returns

  • int The analog reading at 63Hz from 0-1024.

int get160()

Description

Returns the analog value of the MSGEQ7 output at 160Hz. This value is read from its internal variable and will be scaled if the correctOffset flag is set.

Arguements

Returns

  • int The analog reading at 160Hz from 0-1024.

int get400()

Description

Returns the analog value of the MSGEQ7 output at 400Hz. This value is read from its internal variable and will be scaled if the correctOffset flag is set.

Arguements

Returns

  • int The analog reading at 400Hz from 0-1024.

int get1000()

Description

Returns the analog value of the MSGEQ7 output at 1kHz. This value is read from its internal variable and will be scaled if the correctOffset flag is set.

Arguements

Returns

  • int The analog reading at 1kHz from 0-1024.

int get2500()

Description

Returns the analog value of the MSGEQ7 output at 2.5kHz. This value is read from its internal variable and will be scaled if the correctOffset flag is set.

Arguements

Returns

  • int The analog reading at 2.5kHz from 0-1024.

int get6250()

Description

Returns the analog value of the MSGEQ7 output at 6.25kHz. This value is read from its internal variable and will be scaled if the correctOffset flag is set.

Arguements

Returns

  • int The analog reading at 6.25kHz from 0-1024.

int get16000()

Description

Returns the analog value of the MSGEQ7 output at 16kHz. This value is read from its internal variable and will be scaled if the correctOffset flag is set.

Arguements

Returns

  • int The analog reading at 16kHz from 0-1024.

Clone this wiki locally
You can’t perform that action at this time.