SALES INQUIRIES: 1 (888) 767-9864

Arduino Sound to Light NeoPixel display (450 NeoPixels!) :: Student Project

This is a great project submitted by one of our students, Robert.

Robert aligned 25 strips of WS2812 (AKA NeoPixels) resulting in a 450 point matrix.

The display of the matrix is then adjusted based on audio input.  The result is pretty cool looking…

If you think this neat, it would be awesome if you would thumbs up his project on Youtube!

The most difficult part?

I asked Robert what the most difficult part was – his response is below:

“The most difficult part? Making the matrix was a bit tedious.

When you get a 5m roll of LED lights there are lots of joins which you don’t notice at first but they make for a longer spacing than regular and that means that you have to cut those out and re-solder or the lights don’t line up.

Plus cutting 450+ small pieces of wood and gluing them in so as to box in the led ‘cells’ was a bit of an epic endeavour. Once it was all up and running one of the pixels stopped working so that had to be cut out and replaced. After that, coding was the easy part.”

The Arduino Code:

Robert was kind enough to share his code, it is embedded below:

/****************************************
Sound reactive matrix made of 18, 25 pixel strips mounted on A1 foamboard = 450 pixels
Script runs on Arduino Mega 2560 with adafruit autogain mic inputting on A0 and data out to
ws2812b / neopixels from pin 6.
robert robert:
atheistic8@gmail(dot)com
Microphone sampling code courtesy of adafruit - thanks.

****************************************/
#include <Adafruit_NeoPixel.h>
#define NUMBER_PIXEL 450
#define LEDPIN    6
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMBER_PIXEL, LEDPIN, NEO_GRB + NEO_KHZ800);


const int sampleWindow = 50; // Sample window width in mS (50 mS = 20Hz)
unsigned int sample;

void setup()
{
	Serial.begin(9600);//for debugging sound level VU function
	strip.begin();//initiates neopixels
	strip.setBrightness(200);//sets overall brightness 0 - 255. lower = easier power

}


void loop()
{
	//run mic sampling
	unsigned long startMillis = millis(); // Start of sample window
	unsigned int peakToPeak = 0;   // peak-to-peak level

	unsigned int signalMax = 0;
	unsigned int signalMin = 1024;

	// collect data for 50 mS
	while (millis() - startMillis < sampleWindow)
	{
		sample = analogRead(A0);
		if (sample < 1024)  // toss out spurious readings
		{
			if (sample > signalMax)
			{
				signalMax = sample;  // save just the max levels
			}
			else if (sample < signalMin)
			{
				signalMin = sample;  // save just the min levels
			}
		}
	}

	peakToPeak = signalMax - signalMin;  // max - min = peak-peak amplitude
	double volts = (peakToPeak * 3.3) / 1024;  // convert to volts
	Serial.print("input volts = ");//for debugging
	Serial.println(volts);


	float voltBoost = (volts * 100);
	if(voltBoost <= 80) //reject low readings to reduce noise
	{
		voltBoost == 0;
	};

	float VU = map(voltBoost, 15, 150, 0, 8);//maps sound range on to 9 levels which are then used in if statements below to call matrix array functions

	Serial.print("VU mapped = ");//for debugging
	Serial.println(VU);

//	blackOut(); //resets all pixels off - uncomment this for a more rhythmic but also more minimalist effect; also significant power demand reductions


	if (VU == 0)
	{
		blackOut();//clear display so nothing shows when room is quiet
	}

	if (VU == 1)
	{
		int randVU1 = random(1, 7);//at lowest volume a 6 x 7 rectangle flashes in random colours

		if (randVU1 == 1)
		{
			centre48Red();
		}

		if (randVU1 == 2)
		{
			centre48Green ();
		}
		if (randVU1 == 3)
		{
			centre48Blue();
		}
		if (randVU1 == 4)
		{
			centre48Yellow();
		}
		
		if (randVU1 == 5)
		{
			centre48Pink();
		}
		if (randVU1 == 6)
		{
			centre48White();
		}
	}//end if VU==1

	if (VU == 2)
	{
		int randVU2 = random(1, 4);//next level has  the union jack in trad and alt colours plus a blackout option. Note that random (1,4) will only give 3 (1,2,3) random numbers not 4 

		if (randVU2 == 1)
		{
			blackOut();
		}

		if (randVU2 == 2)
		{
			unionFlagRGB();
		}

		if (randVU2 == 3)
		{
			unionFlagOrange();
		}

	}//close if VU==2


	if (VU == 3)
	{
		int randVU3 = random(1, 4);

		if (randVU3 == 1)
		{
			thirdSquareRed();
		}

		if (randVU3 == 2)
		{
			thirdSquareWhite();
		}

		if (randVU3 == 3)
		{
			thirdSquareBlue();
		}
	}//close if VU==3

	if (VU == 4)
	{//open Vu==4
		int randVU4 = random(1, 4);

		if (randVU4 == 1)
		{
			fourthSquare ();
		}

		if (randVU4 == 2)
		{
			fourthCross();
		}
		if (randVU4 == 3)
		{
			multiSquare();
		}

	}//close if VU4

	if (VU == 5)
	{//open Vu==5
		fifthPattern();
	}//close VU 5

	if (VU == 6)
	{//open VU 6
		sixthPattern ();
	}//close VU6

	if (VU == 7)
	{
		//open VU7
		int VU7Rand = random(1, 3);//choice of two needs random 1,3
		if (VU7Rand == 1)
		{
			seventhPattern();
		}
		if (VU7Rand == 2);
		{
			verticalTeeth();
		}
	}//close VU7

	if(VU == 8)
	{
		//open VU8
		diagonalsOrange();
	}//close VU8


}//close void loop

//-------------------functions / patterns below


void centre48Red ()
{
	int centre48Leds[42] =
	{
		290,	289,	288,	287,	286,	285,	284,
		259,	260,	261,	262,	263,	264,	265,
		240,	239,	238,	237,	236,	235,	234,
		209,	210,	211,	212,	213,	214,	215,
		190,	189,	188,	187,	186,	185,	184,
		159,	160,	161,	162,	163,	164,	165
	}; //close array

	for (int i = 0; i < 42; i++)
	{
		strip.setPixelColor(centre48Leds[i], 255, 0, 0);//colour each pixel in array red
	}//close for loop
	strip.show();

}//end red centreFour function
void centre48Blue ()
{
	int centre48Leds[42] =
	{
		290,	289,	288,	287,	286,	285,	284,
		259,	260,	261,	262,	263,	264,	265,
		240,	239,	238,	237,	236,	235,	234,
		209,	210,	211,	212,	213,	214,	215,
		190,	189,	188,	187,	186,	185,	184,
		159,	160,	161,	162,	163,	164,	165
	}; //centreblue

	for (int i = 0; i < 42; i++)
	{
		strip.setPixelColor(centre48Leds[i], 0, 0, 255);
	}//close for loop
	strip.show();

}//end blue centreFour function

void centre48Green ()
{
	int matrix6Leds[42] =
	{
		290,	289,	288,	287,	286,	285,	284,
		259,	260,	261,	262,	263,	264,	265,
		240,	239,	238,	237,	236,	235,	234,
		209,	210,	211,	212,	213,	214,	215,
		190,	189,	188,	187,	186,	185,	184,
		159,	160,	161,	162,	163,	164,	165
	}; //centreArray

	for (int i = 0; i < 42; i++)
	{
		strip.setPixelColor(matrix6Leds[i], 0, 255, 100);
	}//close for loop
	strip.show();

}//end green centre48 function

void centre48Yellow ()
{
	int matrix6Leds[42] =
	{
		290,	289,	288,	287,	286,	285,	284,
		259,	260,	261,	262,	263,	264,	265,
		240,	239,	238,	237,	236,	235,	234,
		209,	210,	211,	212,	213,	214,	215,
		190,	189,	188,	187,	186,	185,	184,
		159,	160,	161,	162,	163,	164,	165
	}; //centreArray

	for (int i = 0; i < 42; i++)
	{
		strip.setPixelColor(matrix6Leds[i], 255, 255, 100);
	}//close for loop
	strip.show();

}//end yellow centre48 function

void centre48Pink ()
{
	int matrix6Leds[42] =
	{
		290,	289,	288,	287,	286,	285,	284,
		259,	260,	261,	262,	263,	264,	265,
		240,	239,	238,	237,	236,	235,	234,
		209,	210,	211,	212,	213,	214,	215,
		190,	189,	188,	187,	186,	185,	184,
		159,	160,	161,	162,	163,	164,	165
	}; //centreArray

	for (int i = 0; i < 42; i++)
	{
		strip.setPixelColor(matrix6Leds[i], 255, 153, 204);
	}//close for loop
	strip.show();

}//end pink centre48 function

void centre48White ()
{
	int matrix6Leds[42] =
	{
		290,	289,	288,	287,	286,	285,	284,
		259,	260,	261,	262,	263,	264,	265,
		240,	239,	238,	237,	236,	235,	234,
		209,	210,	211,	212,	213,	214,	215,
		190,	189,	188,	187,	186,	185,	184,
		159,	160,	161,	162,	163,	164,	165
	}; //centreArray

	for (int i = 0; i < 42; i++)
	{
		strip.setPixelColor(matrix6Leds[i], 255, 255, 255);
	}//close for loop
	strip.show();

}//end white centre48 function


///////////////////////////////////////////////////////////////////////


void secondSquareOrange ()
{
	int mid76Leds[68] =
	{
		342, 341, 340, 339, 338, 337, 336, 335, 334, 333, 332, 307, 308,
		309, 310, 311, 312, 313, 314, 315, 316, 317, 292, 291, 257, 258,
		242, 241, 207, 208, 192, 191, 157, 158, 142, 141, 107, 108, 140,
		139, 138, 137, 136, 135, 134, 133, 132, 109, 110, 111, 112, 113,
		114, 115, 116, 117, 283, 282, 266, 267, 233, 232, 216, 217, 183,
		182, 166, 167
	}; //midsquareArray

	for (int i = 0; i < 68; i++)
	{
		strip.setPixelColor(mid76Leds[i], 255, 153, 51);
	}//close for loop
	strip.show();

}//end midSquareOrange function

void secondSquarePurple ()
{
	int mid76Leds[68] =
	{
		342, 341, 340, 339, 338, 337, 336, 335, 334, 333, 332, 307, 308,
		309, 310, 311, 312, 313, 314, 315, 316, 317, 292, 291, 257, 258,
		242, 241, 207, 208, 192, 191, 157, 158, 142, 141, 107, 108, 140,
		139, 138, 137, 136, 135, 134, 133, 132, 109, 110, 111, 112, 113,
		114, 115, 116, 117, 283, 282, 266, 267, 233, 232, 216, 217, 183,
		182, 166, 167

	}; //midsquareArray

	for (int i = 0; i < 68; i++)
	{
		strip.setPixelColor(mid76Leds[i], 204, 0, 204);
	}//close for loop
	strip.show();

}//end midsquarePurple function

void secondSquareTeal ()
{
	int mid76Leds[68] =
	{
		342, 341, 340, 339, 338, 337, 336, 335, 334, 333, 332, 307, 308,
		309, 310, 311, 312, 313, 314, 315, 316, 317, 292, 291, 257, 258,
		242, 241, 207, 208, 192, 191, 157, 158, 142, 141, 107, 108, 140,
		139, 138, 137, 136, 135, 134, 133, 132, 109, 110, 111, 112, 113,
		114, 115, 116, 117, 283, 282, 266, 267, 233, 232, 216, 217, 183,
		182, 166, 167

	}; //midsquareArray

	for (int i = 0; i < 68; i++)
	{
		strip.setPixelColor(mid76Leds[i], 102, 255, 255);
	}//close for loop
	strip.show();

}//end midsquareTeal function

/////////////////////////////////////////////////////////////////

void thirdSquareRed ()
{
	int matrix6Leds[100] =
	{
		354,	355,	356,	357,	358,	359,	360,	361,	362,	363,
		364,	365,	366,	367,	368,	369,	370,
		345,	344,	343,	342,	341,	340,	339,	338,	337,	336,
		335,	334,	333,	332,	331,	330,	329,
		104,	105,	106,	107,	108,	109,	110,	111,	112,	113,
		114,	115,	116,	117,	118,	119,	120,
		95,	94,	93,	92,	91,	90,	89,	88,	87,	86,	85,	84,	83,	82,	81,	80,	79,
		304,	305,		295,	294,		254,	255,		245,	244,
		204,	205,		195,	194,
		154,	155,		145,	144,		319,	320,		280,	279,
		269,	270,		230,	229,
		219,	220,		180,	179,		169,	170,		130,	129

	}; //3rd squareArray

	for (int i = 0; i < 100; i++)
	{
		strip.setPixelColor(matrix6Leds[i], 255, 0, 0);
	}//close for loop
	strip.show();
}//end thirdSquareRed function


void thirdSquareWhite ()
{
	int matrix6Leds[100] =
	{
		354,	355,	356,	357,	358,	359,	360,	361,	362,
		363,	364,	365,	366,	367,	368,	369,	370,
		345,	344,	343,	342,	341,	340,	339,	338,	337,
		336,	335,	334,	333,	332,	331,	330,	329,
		104,	105,	106,	107,	108,	109,	110,	111,	112,
		113,	114,	115,	116,	117,	118,	119,	120,
		95,	94,	93,	92,	91,	90,	89,	88,	87,	86,	85,	84,	83,	82,	81,	80,	79,
		304,	305,		295,	294,		254,	255,		245,	244,
		204,	205,		195,	194,		154,	155,		145,	144,
		319,	320,		280,	279,		269,	270,		230,	229,
		219,	220,		180,	179,		169,	170,		130,	129
	}; //3rd squareArray

	for (int i = 0; i < 100; i++)
	{
		strip.setPixelColor(matrix6Leds[i], 255, 255, 255);
	}//close for loop
	strip.show();
}//end thirdSquareWhite function

void thirdSquareBlue ()
{
	int matrix6Leds[100] =
	{
		354,	355,	356,	357,	358,	359,	360,	361,	362,	363,	364,	365,	366,	367,	368,	369,	370,
		345,	344,	343,	342,	341,	340,	339,	338,	337,	336,	335,	334,	333,	332,	331,	330,	329,
		104,	105,	106,	107,	108,	109,	110,	111,	112,	113,	114,	115,	116,	117,	118,	119,	120,
		95,	94,	93,	92,	91,	90,	89,	88,	87,	86,	85,	84,	83,	82,	81,	80,	79,
		304,	305,		295,	294,		254,	255,		245,	244,		204,	205,		195,	194,		154,	155,
		145,	144,		319,	320,		280,	279,		269,	270,		230,	229,		219,	220,		180,	179,
		169,	170,		130,	129

	}; //3rd squareArray

	for (int i = 0; i < 100; i++)
	{
		strip.setPixelColor(matrix6Leds[i], 0, 0, 255);
	}//close for loop
	strip.show();
}//end thirdSquareBlue function

///////////////////////////////////////////////////////////////////////////////////
void fourthSquare ()
{
	int matrix6Leds[156] =
	{
		449,	448,	447,	446,	445,	444,	443,	442,	441,	440,	439,	438,	437,	436,	435,	434,	433,	432,	431,	430,	429,	428,	427,	426,	425,
		400,	401,	402,	403,	404,	405,	406,	407,	408,	409,	410,	411,	412,	413,	414,	415,	416,	417,	418,	419,	420,	421,	422,	423,	424,
		49,	48,	47,	46,	45,	44,	43,	42,	41,	40,	39,	38,	37,	36,	35,	34,	33,	32,	31,	30,	29,	28,	27,	26,	25,
		0,	1,	2,	3,	4,	5,	6,	7,	8,	9,	10,	11,	12,	13,	14,	15,	16,	17,	18,	19,	20,	21,	22,	23,	24,
		399,	398,		350,	351,		349,	348,		300,	301,		299,	298,		250,	251,
		249,		248,		200,	201,		199,	198,		150,	151,		149,	148,		100,	101,
		99,	98,		50,	51,		376,	375,		373,	374,		326,	325,		323,	324,		276,	275,
		273,	274,		226,	225,		223,	224,		176,	175,		173,	174,		126,	125,		123,	124,
		76,	75,		73,	74
	}; //edge array

	for (int i = 0; i < 156; i++)
	{
		strip.setPixelColor(matrix6Leds[i], 255, 255, 255);
	}//close for loop
	strip.show();

}//end fourthSquare function
///////////////////////////////////////////////////////////////////////////////////

void multiSquare ()
{
	int matrix6Leds[180] =
	{
		449,		448,		447,		400,		401,		402,		399,		398,		397,		350,		351,
		352,		250,		251,		252,		249,		248,		247,		200,		201,		202,		199,
		198,		197,		99,		98,		97,		50,		51,		52,		49,		48,		47,
		0,	1,		2,		346,		345,		344,		303,		304,		305,		296,		295,		294,		153,
		154,		155,		146,		145,		144,		103,		104,		105,		443,		442,		441,
		406,		407,		408,		393,		392,		391,		356,		357,		358,		256,
		257,		258,		243,		242,		241,		206,		207,		208,		193,		192,		191,		93,		92,
		91,		56,		57,		58,		43,		42,		41,		6,		7,		8,		433,		432,		431,		416,		417,
		418,		383,		382,		381,		366,		367,		368,		266,		267,		268,		233,
		232,		231,		216,		217,		218,		183,		182,		181,		83,		82,		81,		66,
		67,		68,		33,		32,		31,		16,		17,		18,		330,		329,		328,		319,		320,		321,
		280,		279,		278,		169,		170,		171,		130,		129,		128,		119,		120,		121,
		427,		426,		425,		422,		423,		424,		377,		376,		375,		372,		373,		374,
		272,		273,		274,		227,		226,		225,		222,		223,		224,		177,		176,
		175,		77,		76,		75,		72,		73,		74,		27,		26,		25,		22,		23,		24
	}; //multiSquare array

	for (int i = 0; i < 180; i++)
	{
		strip.setPixelColor(matrix6Leds[i],  220, 20, 60);
	}//close for loop
	strip.show();

}//end multiSquare function


//////////////////////////////////////////////////////////////////////////////////

void fourthCross ()
{
	int matrix6Leds[154] =
	{
		438,	437,	436,		411,	412,	413,		388,	387,	386,		361,	362,	363,
		338,	337,	336,		311,	312,	313,		288,	287,	286,		261,	262,	263,
		238,	237,	236,		211,	212,	213,		188,	187,	186,		161,	162,	163,
		138,	137,	136,		111,	112,	113,		88,	87,	86,		61,	62,	63,		38,	37,	36,
		11,	12,	13,		250,	251,	252,	253,	254,	255,	256,	257,	258,	259,	260,	261,	262,	263,	264,	265,	266,	267,	268,	269,	270,	271,	272,	273,	274,
		249,		248,	247,	246,	245,	244,	243,	242,	241,	240,	239,	238,	237,	236,	235,	234,	233,	232,	231,	230,	229,	228,	227,	226,	225,
		200,	201,	202,	203,	204,	205,	206,	207,	208,	209,	210,	211,	212,	213,	214,	215,	216,	217,	218,	219,	220,	221,	222,	223,	224,
		199,	198,	197,	196,	195,	194,	193,	192,	191,	190,	189,	188,	187,	186,	185,	184,	183,	182,	181,	180,	179,	178,	177,	176,	175
	}; //4th cross array

	for (int i = 0; i < 154; i++)
	{
		strip.setPixelColor(matrix6Leds[i], 128, 0, 128);
	}//close for loop
	strip.show();
}//end fourthCross function
///////////////////////////////////////////////////////////////////////////////
void fifthPattern ()
{
	int matrix6Leds[44] =
	{
		437,		413,		385,		365,		333,		317,		281,		269,		229,
		220,		180,		168,		132,		116,		84,		64,		36,		12,		38,
		60,		90,		108,		142,		156,		194,		204,		245,		255,
		293,		307,		341,		359,		389,		411,		261,	262,	263,		238,		236,
		211,		213,		188,	187,	186
	}; //5th matrix pattern

	for (int i = 0; i < 44; i++)
	{
		strip.setPixelColor(matrix6Leds[i], 255, 0, 0);//pink
	}//close for loop
	int matrix6bLeds[250] =
	{
		449,	448,	447,	446,	445,	444,	443,	442,	441,	440,	439,	438,	437,	436,	435,	434,	433,	432,	431,	430,	429,	428,	427,	426,	425,
		400,	401,	402,	403,	404,	405,	406,	407,	408,	409,	410,	411,	412,	413,	414,	415,	416,	417,	418,	419,	420,	421,	422,	423,	424,
		349,	348,	347,	346,	345,	344,	343,	342,	341,	340,	339,	338,	337,	336,	335,	334,	333,	332,	331,	330,	329,	328,	327,	326,	325,
		300,	301,	302,	303,	304,	305,	306,	307,	308,	309,	310,	311,	312,	313,	314,	315,	316,	317,	318,	319,	320,	321,	322,	323,	324,
		249,		248,	247,	246,	245,	244,	243,	242,	241,	240,	239,	238,	237,	236,	235,	234,	233,	232,	231,	230,	229,	228,	227,	226,	225,
		200,	201,	202,	203,	204,	205,	206,	207,	208,	209,	210,	211,	212,	213,	214,	215,	216,	217,	218,	219,	220,	221,	222,	223,	224,
		149,	148,	147,	146,	145,	144,	143,	142,	141,	140,	139,	138,	137,	136,	135,	134,	133,	132,	131,	130,	129,	128,	127,	126,	125,
		100,	101,	102,	103,	104,	105,	106,	107,	108,	109,	110,	111,	112,	113,	114,	115,	116,	117,	118,	119,	120,	121,	122,	123,	124,
		49,	48,	47,	46,	45,	44,	43,	42,	41,	40,	39,	38,	37,	36,	35,	34,	33,	32,	31,	30,	29,	28,	27,	26,	25,
		0,	1,	2,	3,	4,	5,	6,	7,	8,	9,	10,	11,	12,	13,	14,	15,	16,	17,	18,	19,	20,	21,	22,	23,	24
	};
	for (int j = 0; j < 250; j++)
	{
		strip.setPixelColor(matrix6bLeds[j], 153, 204, 255);	//light blue
	}
	strip.show();

}//end fifthPattern function

//////////////////////////////////////////////////////////////////////////////////////////////

void sixthPattern ()
{
	int matrix6Leds[200] =
	{
		400,		401,		402,		403,		404,		405,		406,		407,		408,		409,
		410,		411,		412,		413,		414,		415,		416,		417,		418,		419,
		420,		421,		422,		423,		424,		350,		351,		352,		353,		354,
		355,		356,		357,		358,		359,		360,		361,		362,		363,		364,
		365,		366,		367,		368,		369,		370,		371,		372,		373,		374,
		300,		301,		302,		303,		304,		305,		306,		307,		308,		309,
		310,		311,		312,		313,		314,		315,		316,		317,		318,		319,
		320,		321,		322,		323,		324,		250,		251,		252,		253,		254,
		255,		256,		257,		258,		259,		260,		261,		262,		263,		264,
		265,		266,		267,		268,		269,		270,		271,		272,		273,		274,
		199,		198,		197,		196,		195,		194,		193,		192,		191,		190,
		189,		188,		187,		186,		185,		184,		183,		182,		181,		180,
		179,		178,		177,		176,		175,		149,		148,		147,		146,		145,
		144,		143,		142,		141,		140,		139,		138,		137,		136,		135,
		134,		133,		132,		131,		130,		129,		128,		127,		126,		125,
		99,		98,		97,		96,		95,		94,		93,		92,		91,		90,
		89,		88,		87,		86,		85,		84,		83,		82,		81,		80,
		79,		78,		77,		76,		75,		49,		48,		47,		46,		45,
		44,		43,		42,		41,		40,		39,		38,		37,		36,		35,
		34,		33,		32,		31,		30,		29,		28,		27,		26,		25
	}; //stripes array

	for (int i = 0; i < 200; i++)
	{
		strip.setPixelColor(matrix6Leds[i], 0, 255, 255);
	}//close for loop
	strip.show();

}//end sixthPattern function

////////////////////////////////////////////////////////////////////////////////

void seventhPattern ()
{
	int matrix6Leds[270] =
	{
		449,	448,	447,	446,	445,		400,	401,	402,	403,	404,
		399,	398,	397,	396,	395,		350,	351,	352,	353,	354,
		349,	348,	347,	346,	345,		300,	301,	302,	303,	304,
		299,	298,	297,	296,	295,		250,	251,	252,	253,	254,
		249,		248,	247,	246,	245,		200,	201,	202,	203,	204,
		199,	198,	197,	196,	195,		150,	151,	152,	153,	154,
		149,	148,	147,	146,	145,		100,	101,	102,	103,	104,
		99,	98,	97,	96,	95,		50,	51,	52,	53,	54,		49,	48,	47,	46,	45,		0,	1,	2,	3,	4,
		439,	438,	437,	436,	435,		410,	411,	412,	413,	414,
		389,	388,	387,	386,	385,		360,	361,	362,	363,	364,
		339,	338,	337,	336,	335,		310,	311,	312,	313,	314,
		289,	288,	287,	286,	285,		260,	261,	262,	263,	264,
		239,	238,	237,	236,	235,		210,	211,	212,	213,	214,
		189,	188,	187,	186,	185,		160,	161,	162,	163,	164,
		139,	138,	137,	136,	135,		110,	111,	112,	113,	114,
		89,	88,	87,	86,	85,		60,	61,	62,	63,	64,		39,	38,	37,	36,	35,		10,	11,	12,	13,	14,
		429,	428,	427,	426,	425,		420,	421,	422,	423,	424,
		379,	378,	377,	376,	375,		370,	371,	372,	373,	374,
		329,	328,	327,	326,	325,		320,	321,	322,	323,	324,
		279,	278,	277,	276,	275,		270,	271,	272,	273,	274,
		229,	228,	227,	226,	225,		220,	221,	222,	223,	224,
		179,	178,	177,	176,	175,		170,	171,	172,	173,	174,
		129,	128,	127,	126,	125,		120,	121,	122,	123,	124,
		79,	78,	77,	76,	75,		70,	71,	72,	73,	74,		29,	28,	27,	26,	25,		20,	21,	22,	23,	24
	}; //7th matrix///vertical stripes 5 wide

	for (int i = 0; i < 270; i++)
	{
		strip.setPixelColor(matrix6Leds[i], 100, 0, 255);
	}//close for loop
	strip.show();
}//end seventhPattern function

///////////////////////////////////////////////////////////////////////////////

void blackOut()
{
	for(int i = 0; i < 450; i++)
	{
		strip.setPixelColor(i, 0, 0, 0);
	}
	strip.show();

}//end void blackout()
////////////////////////////////////////////////////////////////////////////////

void unionFlagRGB ()
{
	//open function
	//start by setting the entire matrix blue

	for (int j = 0; j < 450; j++)
	{
		//open for 450
		strip.setPixelColor(j, 0, 0, 255);
	}//close for blue background
	//next over-write the red cross
	int matrix6Leds[154] =//redcross array
	{
		438,	437,	436, 411,	412,	413,			388,	387,	386,			361,	362,	363,
		338,	337,	336,	311,	312,	313,			288,	287,	286,			261,	262,	263,
		238,	237,	236,			211,	212,	213,			188,	187,	186,			161,	162,	163,
		138,	137,	136,		111,	112,	113,			88,	87,	86,			61,	62,	63,
		38,	37,	36,			11,	12,	13,			250,	251,	252,	253,	254,	255,	256,	257,	258,
		259,	260,	261,	262,	263,	264,	265,	266,	267,	268,	269,	270,	271,	272,
		273,	274,			249,			248,	247,	246,	245,	244,	243,	242,	241,	240,	239,
		238,	237,	236,	235,	234,	233,	232,	231,	230,	229,	228,	227,	226,	225,
		200,	201,	202,	203,	204,	205,	206,	207,	208,	209,	210,	211,	212,	213,
		214,	215,	216,	217,	218,	219,	220,	221,	222,	223,	224,			199,	198,
		197,	196,	195,	194,	193,	192,	191,	190,	189,	188,	187,	186,	185,	184,
		183,	182,	181,	180,	179,	178,	177,	176,	175

	}; //close red cross array

	for (int i = 0; i < 154; i++)
	{
		strip.setPixelColor(matrix6Leds[i], 255, 0, 0);
	}//close for loop

	//next over-write the white diagonals cross
	int matrix7Leds[84] =//white diagonals array
	{
		285, 284, 315, 316, 333, 332, 367, 368, 381, 380, 419, 420, 429,
		428, 282, 318, 330, 370, 378, 422, 426, //top right square 21

		165, 164, 134, 133, 116, 117, 82, 81, 68, 69, 30, 29, 20, 21, 167,
		131, 119, 79, 71, 27, 23, //bottom right square 21

		160, 159, 140, 141, 108, 107, 92, 93, 56, 55, 44, 45, 4, 3,
		157, 143, 105, 95, 53, 47, 1, //bottom left square 21

		289, 309, 290, 308, 341, 342, 357, 356, 393, 394, 405,
		404, 445, 446, 292, 306, 344, 354, 396, 402, 448 //top left 21


	};//close white diagonals array

	for (int i = 0; i < 84; i++)
	{
		strip.setPixelColor(matrix7Leds[i], 255, 255, 255);
	}//close for loop white diagonals
	//push all the data to the strip

	strip.show();
}//close union function
//////////////////////////////////////////////////////////////////////////////////

void unionFlagOrange ()
{
	//open function
	//start by setting the entire matrix orange

	for (int j = 0; j < 450; j++)
	{
		//open for 450
		strip.setPixelColor(j, 255, 165, 0);
	}//close for orange background
	//next over-write the green cross
	int matrix6Leds[154] =//cross array
	{
		438,	437,	436, 411,	412,	413,			388,	387,	386,			361,	362,	363,
		338,	337,	336,	311,	312,	313,			288,	287,	286,			261,	262,	263,
		238,	237,	236,			211,	212,	213,			188,	187,	186,			161,	162,	163,
		138,	137,	136,		111,	112,	113,			88,	87,	86,			61,	62,	63,
		38,	37,	36,			11,	12,	13,			250,	251,	252,	253,	254,	255,	256,	257,	258,
		259,	260,	261,	262,	263,	264,	265,	266,	267,	268,	269,	270,	271,	272,
		273,	274,			249,			248,	247,	246,	245,	244,	243,	242,	241,	240,	239,
		238,	237,	236,	235,	234,	233,	232,	231,	230,	229,	228,	227,	226,	225,
		200,	201,	202,	203,	204,	205,	206,	207,	208,	209,	210,	211,	212,	213,
		214,	215,	216,	217,	218,	219,	220,	221,	222,	223,	224,			199,	198,
		197,	196,	195,	194,	193,	192,	191,	190,	189,	188,	187,	186,	185,	184,
		183,	182,	181,	180,	179,	178,	177,	176,	175

	}; //close green cross array

	for (int i = 0; i < 154; i++)
	{
		strip.setPixelColor(matrix6Leds[i], 0, 255, 0);
	}//close for loop

	//next over-write the white diagonals cross
	int matrix7Leds[84] =//white diagonals array
	{
		285, 284, 315, 316, 333, 332, 367, 368, 381, 380, 419, 420, 429,
		428, 282, 318, 330, 370, 378, 422, 426, //top right square 21

		165, 164, 134, 133, 116, 117, 82, 81, 68, 69, 30, 29, 20, 21, 167,
		131, 119, 79, 71, 27, 23, //bottom right square 21

		160, 159, 140, 141, 108, 107, 92, 93, 56, 55, 44, 45, 4, 3,
		157, 143, 105, 95, 53, 47, 1, //bottom left square 21

		289, 309, 290, 308, 341, 342, 357, 356, 393, 394, 405,
		404, 445, 446, 292, 306, 344, 354, 396, 402, 448 //top left 21


	};//close white diagonals array

	for (int i = 0; i < 84; i++)
	{
		strip.setPixelColor(matrix7Leds[i], 255, 255, 255);
	}//close for loop white diagonals
	//push all the data to the strip

	strip.show();
}//close union function
//////////////////////////////////////////////////////////////////////////////////


void diagonalsOrange()
{
	//open diagonalsOrange function

	int matrix6Leds[162] =//diagonals array
	{
		449, 448, 447, 400, 401, 402, 396, 395, 394, 353, 354, 355, 343, 342, 341, 306, 307, 308, 290, 289, //TopLeft corner20
		259, 260, 261, 262, 263, 264, 265, 240, 239, 238, 237, 236, 235, 234, 209, 210, 211, 212, 213, 214,
		215, 190, 189, 188, 187, 186, 185, 184, 249, 248, 247, 246, 245, 244, 243, 242, 241, 200, 201, 202, 203, 204,
		205, 206, 207, 208, 233, 232, 231, 230, 229, 228, 227, 226, 225, 216, 217, 218, 219, 220, 221, 222, 223, 224,
		437, 412, 387, 362, 337, 312, 287, 288, 286, 161, 162, 163, 137, 112, 87, 62, 37, 12, //middle cross 78
		285, 284, 333, 332, 331, 316, 317, 318, 380, 379, 378, 369, 370, 371, 427, 426, 425, 422, 423, 424, //top right corner20
		49, 48, 47, 0, 1, 2, 96, 95, 94, 53, 54, 55, 143, 142, 141, 106, 107, 108, 159, 160, //bottom left corner20
		27, 26, 25, 22, 23, 24, 80, 79, 78, 69, 70, 71, 133, 132, 131, 116, 117, 118, 164, 165 //bottom right corner20
	};

	for (int i = 0; i < 162; i++)
	{
		strip.setPixelColor(matrix6Leds[i], 255, 140, 0);
	}//close for loop white diagonals
	//push all the data to the strip
	strip.show();
}//close diagonalsOrange function

///////////////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void verticalTeeth()
{
	//open function

	int matrix6Leds[234] =//diagonals array
	{

		449, 400, 399, 350, 349, 300, 299, 250, 249, 201, 198, 151, 148, 101, 98, 51, 48, 1, 447, 402, 397,

		352, 347, 302, 297, 252, 247, 203, 196, 153, 146, 103, 96, 53, 46, 3, 445, 404, 395, 354, 345, 304,

		295, 254, 245, 205, 194, 155, 144, 105, 94, 55, 44, 5, 443, 406, 393, 356, 343, 306, 293, 256, 243,

		207, 192, 157, 142, 107, 92, 57, 42, 7, 441, 408, 391, 358, 341, 308, 291, 258, 241, 209, 190, 159,

		140, 109, 90, 59, 40, 9, 439, 410, 389, 360, 339, 310, 289, 260, 239, 211, 188, 161, 138, 111, 88,

		61, 38, 11, 437, 412, 387, 362, 337, 312, 287, 262, 237, 213, 186, 163, 136, 113, 86, 63, 36, 13,

		435, 414, 385, 364, 335, 314, 285, 264, 235, 433, 416, 383, 366, 333, 316, 283, 266, 233, 215, 184,

		165, 134, 115, 84, 65, 34, 15, 433, 416, 383, 366, 333, 316, 283, 266, 233, 217, 182, 167, 132, 117,

		82, 67, 32, 17, 431, 418, 381, 368, 331, 318, 281, 268, 231, 219, 180, 169, 130, 119, 80, 69, 30,

		19, 429, 420, 379, 370, 329, 320, 279, 270, 229, 221, 178, 171, 128, 121, 78, 71, 28, 21, 427, 422,

		377, 372, 327, 322, 277, 272, 227, 223, 176, 173, 126, 123, 76, 73, 26, 23, 425, 424, 375, 374, 325,

		324, 275, 274, 225
	};

	for (int i = 0; i < 234; i++)
	{
		strip.setPixelColor(matrix6Leds[i], 0, 0, 0);
	}//close for loop white diagonals
	//push all the data to the strip

	strip.show();

}//close teeth function

/////////////////////////////////////////////////////////////////////////////////////////

Some other Notes on the Project:

Great project Robert!

1 Comment

  1. […] aligned 25 strips of WS2812 also known as NeoPixels, resulting in a 450 point matrix. The display of the matrix then adjusted based on sampling audio […]

Leave a Comment