Hi,
I'm trying to build an arduino equalizer and is almost done but I have the following problem:
I use this code to read the values form an msgeq7 chip.:
void readaudio(){
digitalWrite(resetPin, HIGH);
digitalWrite(resetPin, LOW);
avg = 0;
soundPeak = 0;
for (int i = 0; i < 7; i++) {
digitalWrite(strobePin, LOW);
delayMicroseconds(30); // to allow the output to settle
spectrumValue[i]=analogRead(audioOutput) * sensitivity;
if (spectrumValue[i] > soundPeak) {
soundPeak = spectrumValue[i];
}
avg += spectrumValue[i];
digitalWrite(strobePin, HIGH);
soundValues[i] = spectrumValue[i] ;
}
soundAvarage = avg/7;
}
The problem is that every time I turn the system onthe frequencies are not always in the same array index, sometimes the lowest bass is on spectrumValue[5] sometimes in spectrumValue[3] and so on so i can't get it to look right.
Any toughts?
Sorry if it has been asked here, i did some searches and could not find it.
Thank you.
Luis