Most of what this program does, that is breaking down the analog input into bands, the MSGEQ7 already does. Please spend some time explaining what you are wanting to do in more detail. What do you want to do? Why do you want to use the MSGEQ7 chip? What is the microphone module you will be using? Are you wanting help with the schematic or the program or both? What do you have so far?
Hi, thanks for your interest, in this code you can see this one led blinking every time when bandpass filter sends signal to arduino but in upper sketch each one led blink only once in time period,this work on first sketch, in first time when is peak reached first led will blink in second time when is peak reached will blink second led in third time when is peak reached will blink third led, in fourht time when is peak reached will blink fourth led, i would like apply this with MSGEQ7 chip, because i wanna use one form for signall proccesing, not microphone and MSGEQ7 together.
int analogPin = 0; // MSGEQ7 OUT
int strobePin = 4; // MSGEQ7 STROBE
int resetPin = 3; // MSGEQ7 RESET
int spectrumValue[7];
int i = 0;
// MSGEQ7 OUT pin produces values around 50-80
// when there is no input, so use this value to
// filter out a lot of the chaff.
int filterValue = 988;
// LED pins connected to the PWM pins on the Arduino
int ledPinW = 10;
int ledPinR = 9;
int ledPinG = 8;
int ledPinB = 7;
void setup()
{
// Read from MSGEQ7 OUT
pinMode(analogPin, INPUT);
// Write to MSGEQ7 STROBE and RESET
pinMode(strobePin, OUTPUT);
pinMode(resetPin, OUTPUT);
// Set analogPin's reference voltage
analogReference(DEFAULT); // 5V
// Set startup values for pins
digitalWrite(resetPin, LOW);
digitalWrite(strobePin, HIGH);
}
void loop()
{
// Set reset pin low to enable strobe
digitalWrite(resetPin, HIGH);
digitalWrite(resetPin, LOW);
// Get all 7 spectrum values from the MSGEQ7
for (int i = 0; i < 7; i++)
{
digitalWrite(strobePin, LOW);
delayMicroseconds(1000); // Allow output to settle
spectrumValue[i] = analogRead(analogPin);
// Constrain any value above 1023 or below filterValue
spectrumValue[i] = constrain(spectrumValue[i], filterValue, 511);
// Remap the value to a number between 0 and 255
spectrumValue[i] = map(spectrumValue[i], filterValue, 511, 0, 255);
// Remove serial stuff after debugging
digitalWrite(strobePin, HIGH);
}
// Write the PWM values to the LEDs
// I find that with three LEDs, these three spectrum values work the best
analogWrite(ledPinW, spectrumValue[4]);
}
The code working for only one output, code can be used for 6 outputs like a spectral analyzer but i do not need this.