Hello all,
I am trying to replicate what this fellow is doing:
and got the msgeq7, audio jacks, capacitors, resistors....etc.
I put it together like this only minus the LED's
http://www.n00bsys0p.co.uk/sites/default/files/MSGEQ7_bb.png
I found some decent looking code that appears all over my searches, however, when I run it it gives all 0's to start then after about 10-15 seconds appears to count down erratically from 999 sometimes jumping back up. I've sent three different sources of audio through the jacks I have and other than some component being bad I don't know what else to do. Everyone else seems to have a design that works well almost immediately. Any advice on diagnosing my issue?
Here is the code I've been running:
int analogPin = 0; // read from multiplexer using analog input 0
int strobePin = 2; // strobe is attached to digital pin 2
int resetPin = 3; // reset is attached to digital pin 3
int spectrumValue[7]; // to hold a2d values
void setup()
{
Serial.begin(9600);
pinMode(analogPin, INPUT);
pinMode(strobePin, OUTPUT);
pinMode(resetPin, OUTPUT);
analogReference(DEFAULT);
digitalWrite(resetPin, LOW);
digitalWrite(strobePin, HIGH);
Serial.println("MSGEQ7 test by J Skoba");
}
void loop()
{
digitalWrite(resetPin, HIGH);
digitalWrite(resetPin, LOW);
for (int i = 0; i < 7; i++)
{
digitalWrite(strobePin, LOW);
delayMicroseconds(30); // to allow the output to settle
spectrumValue = analogRead(analogPin);
// comment out/remove the serial stuff to go faster
// - its just here for show
if (spectrumValue < 10)
{
Serial.print(" ");
Serial.print(spectrumValue*);*
}
else if (spectrumValue < 100 )
{
Serial.print(" ");
Serial.print(spectrumValue*);*
}
else
{
Serial.print(" ");
Serial.print(spectrumValue*);*
}
digitalWrite(strobePin, HIGH);
}
Serial.println();
}