LED Audio Spectrum - HELP!

Hi,

I'm currently in Yr 11 and for Systems I have to make a speaker. I have decided to put a LED audio spectrum on the side and found this,

http://www.instructables.com/id/Arduino-LED-Audio-Spectrum/?ALLSTEPS

I tried going through the code to understand it but I have never done anything like this before. i am able to understand bits and pieces but not all of it. Could someone please have a look at it and let me know what they think.

Thanks Corey K

Without looking I can tell you it is crap. Over 99% of electronic Instructables are. They are written by people with a misguided view of there own ability so never ever use them to try and learn stuff because you will be learning wrong.

We are fed up here being used as an Instructables fixing centre so please find another web site and we will gladly explain what is going on.

Are there any pages you would recommend

You will need Spectrum Shield from SparkFun

Run this code to make sure all of your LEDs work

int colpin1 = 7;
int colpin2 = 8;
int colpin3 = 9;
int colpin4 = 10;
int colpin5 = 11;
int colpin6 = 12;
int colpin7 = 13;


int rowpin1 = 6;
int rowpin2 = A2;
int rowpin3 = A3;
int rowpin4 = A4;
int rowpin5 = A5;

int strobe = 4; // strobe pins on digital 4
int res = 5; // reset pins on digital 5
int left[7]; // store band values in these arrays
int right[7];
int band;
void setup()
{

	Serial.begin(115200);
	pinMode(res, OUTPUT); // reset
	pinMode(strobe, OUTPUT); // strobe

	pinMode(colpin1, OUTPUT); // strobe
	pinMode(colpin2, OUTPUT); // strobe
	pinMode(colpin3, OUTPUT); // strobe
	pinMode(colpin4, OUTPUT); // strobe
	pinMode(colpin5, OUTPUT); // strobe
	pinMode(colpin6, OUTPUT); // strobe
	pinMode(colpin7, OUTPUT); // strobe

	pinMode(rowpin1, OUTPUT); // strobe
	pinMode(rowpin2, OUTPUT); // strobe
	pinMode(rowpin3, OUTPUT); // strobe
	pinMode(rowpin4, OUTPUT); // strobe
	pinMode(rowpin5, OUTPUT); // strobe

	digitalWrite(res,LOW); // reset low
	digitalWrite(strobe,HIGH); //pin 5 is RESET on the shield
}

void loop()
{

	spec(colpin1, 5);
	spec(colpin2, 5);
	spec(colpin3, 5);
	spec(colpin4, 5);
	spec(colpin5, 5);
	spec(colpin6, 5);
	spec(colpin7, 5);

}

void readMSGEQ7()
// Function to read 7 band equalizers
{
	digitalWrite(res, HIGH);
	digitalWrite(res, LOW);
	for(band=0; band < 7; band++)
	{
		digitalWrite(strobe,LOW); // strobe pin on the shield - kicks the IC up to the next band 
		delayMicroseconds(30); // 
		left[band] = analogRead(0); // store left band reading
		right[band] = analogRead(1); // ... and the right
		digitalWrite(strobe,HIGH); 
	}
}

void spec(int col, int height)
{
	digitalWrite(colpin1, HIGH); 
	digitalWrite(colpin2, HIGH); 
	digitalWrite(colpin3, HIGH); 
	digitalWrite(colpin4, HIGH); 
	digitalWrite(colpin5, HIGH); 
	digitalWrite(colpin6, HIGH);
	digitalWrite(colpin7, HIGH); 

	digitalWrite(col, LOW);


	digitalWrite(rowpin1, LOW); 
	digitalWrite(rowpin2, LOW); 
	digitalWrite(rowpin3, LOW); 
	digitalWrite(rowpin4, LOW);
	digitalWrite(rowpin5, LOW);
	//for height
	if(height > 0)
	{
		digitalWrite(rowpin1, HIGH); 
	}

	if(height > 1)
	{
		digitalWrite(rowpin2, HIGH); 
	}
	if(height > 2)
	{
		digitalWrite(rowpin3, HIGH); 
	}

	if(height > 3)
	{
		digitalWrite(rowpin4, HIGH); 
	}

	if(height > 4)
	{
		digitalWrite(rowpin5, HIGH); 
	}

	delay(2);
}

This code using Multiplexing to light up to audio

/*
by Ody
12-2015
*/
int colpin1 = 7;
int colpin2 = 8;
int colpin3 = 9;
int colpin4 = 10;
int colpin5 = 11;
int colpin6 = 12;
int colpin7 = 13;


int rowpin1 = 6;
int rowpin2 = A2;
int rowpin3 = A3;
int rowpin4 = A4;
int rowpin5 = A5;

int strobe = 4; // strobe pins on digital 4
int res = 5; // reset pins on digital 5
int left[7]; // store band values in these arrays
int right[7];
int band;

void setup()
{

	Serial.begin(115200);
	pinMode(res, OUTPUT); // reset
	pinMode(strobe, OUTPUT); // strobe

	pinMode(colpin1, OUTPUT);
	pinMode(colpin2, OUTPUT);
	pinMode(colpin3, OUTPUT);
	pinMode(colpin4, OUTPUT);
	pinMode(colpin5, OUTPUT);
	pinMode(colpin6, OUTPUT);
	pinMode(colpin7, OUTPUT);

	pinMode(rowpin1, OUTPUT);
	pinMode(rowpin2, OUTPUT);
	pinMode(rowpin3, OUTPUT);
	pinMode(rowpin4, OUTPUT);
	pinMode(rowpin5, OUTPUT);

	digitalWrite(res, LOW); // reset low
	digitalWrite(strobe, HIGH); //pin 5 is RESET on the shield
}

void loop()
{
	readMSGEQ7();


	// display values of left channel on serial monitor
	for (band = 0; band < 7; band++)
	{
		Serial.print(left[band]);
		Serial.print(" ");
	}
	Serial.println(" - Left ");
	// display values of right channel on serial monitor
	for (band = 0; band < 7; band++)
	{
		Serial.print(right[band]);
		Serial.print(" ");
	}
	Serial.println(" - Right" );



	spec(colpin1, left[0]);
	spec(colpin2, left[1]);
	spec(colpin3, left[2]);
	spec(colpin4, left[3]);
	spec(colpin5, left[4]);
	spec(colpin6, left[5]);
	spec(colpin7, left[6]);

	/*
	spec(colpin1, right[0]);
	spec(colpin2, right[1]);
	spec(colpin3, right[2]);
	spec(colpin4, right[3]);
	spec(colpin5, right[4]);
	spec(colpin6, right[5]);
	spec(colpin7, right[6]);
	*/
}

void readMSGEQ7()
// Function to read 7 band equalizers
{
	digitalWrite(res, HIGH);
	digitalWrite(res, LOW);
	for (band = 0; band < 7; band++)
	{
		digitalWrite(strobe, LOW); // strobe pin on the shield - kicks the IC up to the next band 
		delayMicroseconds(30); // 
		left[band] = analogRead(0); // store left band reading
		right[band] = analogRead(1); // ... and the right
		digitalWrite(strobe, HIGH);
	}
}

// function that lights of a column depending on height
void spec(int col, int height)
{
	digitalWrite(colpin1, HIGH);
	digitalWrite(colpin2, HIGH);
	digitalWrite(colpin3, HIGH);
	digitalWrite(colpin4, HIGH);
	digitalWrite(colpin5, HIGH);
	digitalWrite(colpin6, HIGH);
	digitalWrite(colpin7, HIGH);

	digitalWrite(rowpin1, LOW);
	digitalWrite(rowpin2, LOW);
	digitalWrite(rowpin3, LOW);
	digitalWrite(rowpin4, LOW);
	digitalWrite(rowpin5, LOW);

	digitalWrite(col, LOW);

	//for height
	if (height > 73)
	{
		digitalWrite(rowpin1, HIGH);
	}

	if (height > 80)
	{
		digitalWrite(rowpin2, HIGH);
	}

	if (height > 100)
	{
		digitalWrite(rowpin3, HIGH);
	}

	if (height > 120)
	{
		digitalWrite(rowpin4, HIGH);
	}

	if (height > 140)
	{
		digitalWrite(rowpin5, HIGH);
	}

	delay(2);
}

Billho. So if i follow the instructors and use the codes it will work?

THanks

Yes, it will work, watch out for noise in the power supply.

Ok, thanks so much