Darian-Frey_LED_Cube/Arduino/Code/cube_test_8.pde

int pins[] = {42,40,27,25,35,33,44,38,29,23,37,31,50,48,26,24,43,41,52,46,28,22,45,39,5,6,34,32,51,49,4,7,36,30,53,47 ,13,12,11,10,9,8};
int cl = 42;    // colom lengh
int fl = 1;     // frame lengh
int fm = 40;    // frame number
int dt[] = { 1000,1000,1000,1000,1000,1000,3000,1000,1000,2000,1000,1000,1000,1000,1000,2000,1000,1000,2000,2000,2000,2000,2000,1000,1000,3000,1000,1000,1000,1000,1000,3000,1000,1000,3000,1000,1000,1000,1000,1000,1000 };  // delay time for each colom
int da[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0, //1

0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0, 1,0,0,0,0,0, //2
0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0, 1,1,0,0,0,0, //3
0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0, 1,1,1,0,0,0, //4
0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0, 1,1,1,1,0,0, //5
0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0, 1,1,1,1,1,0, //6
0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0, 1,1,1,1,1,1, //7

0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0, 1,1,1,1,1,1, //8
1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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,1,1,1, //32

1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,1,1,1, //33
0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,1,1,1, //34
0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,1,1,1, //35

0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,1,1,0, //36
0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,1,0,0, //37
0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,0,0,0, //38
0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,0,0,0,0, //39
0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0, 1,0,0,0,0,0, //40

};    // animation data

void setup()
{
	int i;
	for (i = 0; i < cl; i++)
		pinMode(pins[i], OUTPUT);
}

void loop()
{
	int a,b,c;
	
	for (a = 0; a < fm; a++)
	{
		for (b = 0; b < fl; b++)
		{
			for (c = 0; c < cl; c++)
			{
				if (da[a*fl*cl + b*cl + c] == 0) {digitalWrite(pins[c], LOW);}
				else {digitalWrite(pins[c], HIGH);}
			}
		}
		for (c = 0; c < cl; c++)
                delayMicroseconds(dt[a]);
		{digitalWrite(pins[c], LOW);}
		
	}
}
