So I got my MSGEQ7 chip, but for some reason it only outputs a constant 5v. (I have checked my A0 pin and it reads 0 if grounded and 1023 at 5V) I have looked at this post and tried to solve my mistakes as well
Here is my code and the wiring schematic can be seen in the other post, but if needed I can show it as well.
#define STROBE 4
#define RESET 5
#define DC A0
int Frequencies[7];
void setup() {
Serial.begin(9600);
pinMode(STROBE, OUTPUT);
pinMode(RESET, OUTPUT);
Serial.println("63Hz,106Hz,400Hz,1kHz,2.5kHz,6.25kHz,16kHz");
}
void loop() {
Read_Frequencies();
Graph_Frequencies();
delay(50);
}
void Read_Frequencies() {
//Read frequencies for each band
digitalWrite(RESET, HIGH);
digitalWrite(RESET, LOW); // HIGH to LOW resets the MSGEQ7.
for (int freq_amp = 0; freq_amp < 7; freq_amp++) {
digitalWrite(STROBE, LOW);
delayMicroseconds(30);
Frequencies[freq_amp] = analogRead(DC);
digitalWrite(STROBE, HIGH);
}
}
void Graph_Frequencies() {
for (int i = 0; i < 7; i++) {
Serial.print(Frequencies[i]/4);
Serial.print(",");
}
Serial.println("");
}