You are on page 1of 16

#include <avr/pgmspace.

h> // allows use of PROGMEM to store patterns in flash


#define
#define
#define
#define

CUBESIZE 4
PLANESIZE CUBESIZE*CUBESIZE
PLANETIME 3333 // time each plane is displayed in us -> 100 Hz refresh
TIMECONST 20 // multiplies DisplayTime to get ms - why not =100?

prog_uchar PROGMEM PatternTable[] = {


// blink on and off
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000, B0000
,B0000,B0000,B0000, 100,

0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,

// circle full layer at bottom


B0000,B0000,B0100,B0000, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 20,
B0000,B0000,B0110,B0000, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 20,
B0000,B0010,B0110,B0000, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 20,
B0000,B0110,B0110,B0000, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 20,
B0000,B1110,B0110,B0000, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 20,
B0000,B1110,B1110,B0000, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 20,
B0000,B1110,B1110,B1000, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 20,
B0000,B1110,B1110,B1100, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 20,
B0000,B1110,B1110,B1110, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 20,
B0000,B1110,B1110,B1111, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 20,
B0000,B1110,B1111,B1111, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 20,
B0000,B1111,B1111,B1111, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 20,
B0001,B1111,B1111,B1111, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 20,
B0011,B1111,B1111,B1111, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 20,
B0111,B1111,B1111,B1111, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 20,
B1111,B1111,B1111,B1111, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 20,

B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 20,
// circle full layer at bottom
B0000,B0000,B0100,B0000, B0000,B0000,B0100,B0000,
0, B0000,B0000,B0100,B0000, 10,
B0000,B0000,B0110,B0000, B0000,B0000,B0110,B0000,
0, B0000,B0000,B0110,B0000, 10,
B0000,B0010,B0110,B0000, B0000,B0010,B0110,B0000,
0, B0000,B0010,B0110,B0000, 10,
B0000,B0110,B0110,B0000, B0000,B0110,B0110,B0000,
0, B0000,B0110,B0110,B0000, 10,
B0000,B1110,B0110,B0000, B0000,B1110,B0110,B0000,
0, B0000,B1110,B0110,B0000, 10,

B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0100,B000
B0000,B0000,B0110,B000
B0000,B0010,B0110,B000
B0000,B0110,B0110,B000
B0000,B1110,B0110,B000

B0000,B1110,B1110,B0000,
0, B0000,B1110,B1110,B0000, 10,
B0000,B1110,B1110,B1000,
0, B0000,B1110,B1110,B1000, 10,
B0000,B1110,B1110,B1100,
0, B0000,B1110,B1110,B1100, 10,
B0000,B1110,B1110,B1110,
0, B0000,B1110,B1110,B1110, 10,
B0000,B1110,B1110,B1111,
1, B0000,B1110,B1110,B1111, 10,
B0000,B1110,B1111,B1111,
1, B0000,B1110,B1111,B1111, 10,
B0000,B1111,B1111,B1111,
1, B0000,B1111,B1111,B1111, 10,
B0001,B1111,B1111,B1111,
1, B0001,B1111,B1111,B1111, 10,
B0011,B1111,B1111,B1111,
1, B0011,B1111,B1111,B1111, 10,
B0111,B1111,B1111,B1111,
1, B0111,B1111,B1111,B1111, 10,
B1111,B1111,B1111,B1111,
1, B1111,B1111,B1111,B1111, 10,

0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,

0,
0,
0,
0,
0,

B0000,B1110,B1110,B0000, B0000,B1110,B1110,B000
B0000,B1110,B1110,B1000, B0000,B1110,B1110,B100
B0000,B1110,B1110,B1100, B0000,B1110,B1110,B110
B0000,B1110,B1110,B1110, B0000,B1110,B1110,B111
B0000,B1110,B1110,B1111, B0000,B1110,B1110,B111
B0000,B1110,B1111,B1111, B0000,B1110,B1111,B111
B0000,B1111,B1111,B1111, B0000,B1111,B1111,B111
B0001,B1111,B1111,B1111, B0001,B1111,B1111,B111
B0011,B1111,B1111,B1111, B0011,B1111,B1111,B111
B0111,B1111,B1111,B1111, B0111,B1111,B1111,B111
B1111,B1111,B1111,B1111, B1111,B1111,B1111,B111

// loop all borders around


B1111,B0000,B0000,B0000, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 5,
B0000,B1111,B0000,B0000, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 5,
B0000,B0000,B1111,B0000, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 5,
B0000,B0000,B0000,B1111, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 5,
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B1111,
B0000,B0000,B0000,B0000, 5,
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 5,
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B1111, 5,
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000,
B0000,B0000,B1111,B0000, 5,
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000,
B0000,B1111,B0000,B0000, 5,
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000,
B1111,B0000,B0000,B0000, 5,
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 5,
B0000,B0000,B0000,B0000, B1111,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 5,
// and again
B1111,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 2,
B0000,B1111,B0000,B0000,
B0000,B0000,B0000,B0000, 2,
B0000,B0000,B1111,B0000,
B0000,B0000,B0000,B0000, 2,
B0000,B0000,B0000,B1111,
B0000,B0000,B0000,B0000, 2,
B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 2,

B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B111
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B1111,B0000,B0000,B000
B0000,B0000,B0000,B000

B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B1111, B0000,B0000,B0000,B000

B0000,B0000,B0000,B0000,
1, B0000,B0000,B0000,B0000, 2,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B1111, 2,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B1111,B0000, 2,
B0000,B0000,B0000,B0000,
0, B0000,B1111,B0000,B0000, 2,
B0000,B0000,B0000,B0000,
0, B1111,B0000,B0000,B0000, 2,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 2,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 2,
B1111,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 2,

1,
0,
1,
0,
1,
0,
1,
1,
1,
1,
1,
0,
0,

0,
0,
0,
0,
0,
0,

// all borders
B1111,B1001,B1001,B1111,
B1111,B1001,B1001,B1111, 10,
B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 10,
B1111,B1001,B1001,B1111,
B1111,B1001,B1001,B1111, 10,
B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 10,
B1111,B1001,B1001,B1111,
B1111,B1001,B1001,B1111, 10,
B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 10,
// all borders fall down
B1111,B1001,B1001,B1111,
B1111,B1001,B1001,B1111, 100,
B1111,B1001,B1001,B1111,
B0000,B1111,B1001,B1111, 8,
B1111,B1001,B1001,B1111,
B0000,B0000,B1111,B1111, 8,
B1111,B1001,B1001,B1111,
B0000,B0000,B0000,B1111, 8,
B0000,B1111,B1001,B1111,
B0000,B0000,B0000,B0000, 8,
B0000,B0000,B1111,B1111,
B0000,B0000,B0000,B0000, 8,
B0000,B0000,B0000,B1111,
B0000,B0000,B0000,B0000, 8,

B0000,B0000,B0000,B0000, B0000,B0000,B0000,B111
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B1111,B0000,B0000,B000
B1111,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000

B1001,B0000,B0000,B1001, B1001,B0000,B0000,B100
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B1001,B0000,B0000,B1001, B1001,B0000,B0000,B100
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B1001,B0000,B0000,B1001, B1001,B0000,B0000,B100
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
from back top to front bottom
B1001,B0000,B0000,B1001, B1001,B0000,B0000,B100
B1001,B0000,B0000,B1001, B1111,B0000,B0000,B100
B1111,B0000,B0000,B1001, B0000,B1111,B0000,B100
B0000,B1111,B0000,B1001, B0000,B0000,B1111,B100
B0000,B0000,B1111,B1001, B0000,B0000,B0000,B111
B0000,B0000,B0000,B1111, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000

// 4 at the time to make a block


B0000,B0000,B0011,B0011, B0000,B0000,B0011,B0011,
B0000,B0000,B0000,B0000, 10, // left bottom front
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000,
B1100,B1100,B0000,B0000, 10, // right top, back
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000,
B0000,B0000,B1100,B1100, 10, // right top, front
B0011,B0011,B0000,B0000, B0011,B0011,B0000,B0000,
B0000,B0000,B0000,B0000, 10, // left bottom, back
B0000,B0000,B1100,B1100, B0000,B0000,B1100,B1100,
B0000,B0000,B0000,B0000, 10, // right bottom front
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000,
B0011,B0011,B0000,B0000, 10, // left top, back
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000,

B0000,B0000,B0000,B000
B1100,B1100,B0000,B000
B0000,B0000,B1100,B110
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0011,B0011,B0000,B000
B0000,B0000,B0011,B001

1, B0000,B0000,B0011,B0011, 10, // left top, front


B1100,B1100,B0000,B0000, B1100,B1100,B0000,B0000, B0000,B0000,B0000,B000
0, B0000,B0000,B0000,B0000, 10, // right bottom, back

0,
0,
1,
0,

// rotate corner 4 leds


B0000,B0000,B0011,B0011, B0000,B0000,B0011,B0011, B1100,B1100,B0000,B000
B1100,B1100,B0000,B0000, 20, // left bottom front and right top, back
B0000,B0000,B1100,B1100, B0000,B0000,B1100,B1100, B0011,B0011,B0000,B000
B0011,B0011,B0000,B0000, 20, // right bottom front and left top, back
B1100,B1100,B0000,B0000, B1100,B1100,B0000,B0000, B0000,B0000,B0011,B001
B0000,B0000,B0011,B0011, 20, // left top, front and right bottom, back
B0011,B0011,B0000,B0000, B0011,B0011,B0000,B0000, B0000,B0000,B1100,B110
B0000,B0000,B1100,B1100, 20, // left bottom, back and right top, front

B0000,B0000,B0011,B0011, B0000,B0000,B0011,B0011, B1100,B1100,B0000,B000


0, B1100,B1100,B0000,B0000, 15, // left bottom front and right top, back
B0000,B0000,B1100,B1100, B0000,B0000,B1100,B1100, B0011,B0011,B0000,B000
0, B0011,B0011,B0000,B0000, 15, // right bottom front and left top, back
B1100,B1100,B0000,B0000, B1100,B1100,B0000,B0000, B0000,B0000,B0011,B001
1, B0000,B0000,B0011,B0011, 15, // left top, front and right bottom, back
B0011,B0011,B0000,B0000, B0011,B0011,B0000,B0000, B0000,B0000,B1100,B110
0, B0000,B0000,B1100,B1100, 15, // left bottom, back and right top, front
B0000,B0000,B0011,B0011, B0000,B0000,B0011,B0011, B1100,B1100,B0000,B000
0, B1100,B1100,B0000,B0000, 10, // left bottom front and right top, back
B0000,B0000,B1100,B1100, B0000,B0000,B1100,B1100, B0011,B0011,B0000,B000
0, B0011,B0011,B0000,B0000, 10, // right bottom front and left top, back
B1100,B1100,B0000,B0000, B1100,B1100,B0000,B0000, B0000,B0000,B0011,B001
1, B0000,B0000,B0011,B0011, 10, // left top, front and right bottom, back
B0011,B0011,B0000,B0000, B0011,B0011,B0000,B0000, B0000,B0000,B1100,B110
0, B0000,B0000,B1100,B1100, 10, // left bottom, back and right top, front
B0000,B0000,B0011,B0011, B0000,B0000,B0011,B0011, B1100,B1100,B0000,B000
0, B1100,B1100,B0000,B0000, 7, // left bottom front and right top, back
B0000,B0000,B1100,B1100, B0000,B0000,B1100,B1100, B0011,B0011,B0000,B000
0, B0011,B0011,B0000,B0000, 7, // right bottom front and left top, back
B1100,B1100,B0000,B0000, B1100,B1100,B0000,B0000, B0000,B0000,B0011,B001
1, B0000,B0000,B0011,B0011, 7, // left top, front and right bottom, back
B0011,B0011,B0000,B0000, B0011,B0011,B0000,B0000, B0000,B0000,B1100,B110
0, B0000,B0000,B1100,B1100, 7, // left bottom, back and right top, front
B0000,B0000,B0011,B0011, B0000,B0000,B0011,B0011, B1100,B1100,B0000,B000
0, B1100,B1100,B0000,B0000, 5, // left bottom front and right top, back
B0000,B0000,B1100,B1100, B0000,B0000,B1100,B1100, B0011,B0011,B0000,B000
0, B0011,B0011,B0000,B0000, 5, // right bottom front and left top, back
B1100,B1100,B0000,B0000, B1100,B1100,B0000,B0000, B0000,B0000,B0011,B001
1, B0000,B0000,B0011,B0011, 5, // left top, front and right bottom, back
B0011,B0011,B0000,B0000, B0011,B0011,B0000,B0000, B0000,B0000,B1100,B110
0, B0000,B0000,B1100,B1100, 5, // left bottom, back and right top, front
B0000,B0000,B0011,B0011, B0000,B0000,B0011,B0011, B1100,B1100,B0000,B000
0, B1100,B1100,B0000,B0000, 2, // left bottom front and right top, back
B0000,B0000,B1100,B1100, B0000,B0000,B1100,B1100, B0011,B0011,B0000,B000
0, B0011,B0011,B0000,B0000, 2, // right bottom front and left top, back
B1100,B1100,B0000,B0000, B1100,B1100,B0000,B0000, B0000,B0000,B0011,B001
1, B0000,B0000,B0011,B0011, 2, // left top, front and right bottom, back
B0011,B0011,B0000,B0000, B0011,B0011,B0000,B0000, B0000,B0000,B1100,B110
0, B0000,B0000,B1100,B1100, 2, // left bottom, back and right top, front

0,
0,
0,
0,
0,
0,
0,

0,
0,
0,
0,
0,
0,

0,
0,
0,
0,
0,
0,

0,
0,
1,
0,
1,
0,
0,

// bottom layer, to top though middle


B1111,B1111,B1111,B1111, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 30,
B0000,B0110,B0110,B0000, B0000,B0110,B0110,B0000,
B0000,B0110,B0110,B0000, 2,
B0000,B0000,B0000,B0000, B0000,B0110,B0110,B0000,
B0000,B0110,B0110,B0000, 2,
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000,
B0000,B0110,B0110,B0000, 2,
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000,
B0000,B0110,B0110,B0000, 2,
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000,
B1111,B1111,B1111,B1111, 20,
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 10,
// loop top and bottom corners
B0100,B0000,B0000,B0010, B0000,B0000,B0000,B0000,
B0100,B0000,B0000,B0010, 5,
B0010,B0000,B0000,B0100, B0000,B0000,B0000,B0000,
B0010,B0000,B0000,B0100, 5,
B0001,B0000,B0000,B1000, B0000,B0000,B0000,B0000,
B0001,B0000,B0000,B1000, 5,
B0000,B0001,B1000,B0000, B0000,B0000,B0000,B0000,
B0000,B0001,B1000,B0000, 5,
B0000,B1000,B0001,B0000, B0000,B0000,B0000,B0000,
B0000,B1000,B0001,B0000, 5,
B1000,B0000,B0000,B0001, B0000,B0000,B0000,B0000,
B1000,B0000,B0000,B0001, 5,
// again
B0100,B0000,B0000,B0010,
B0100,B0000,B0000,B0010, 5,
B0010,B0000,B0000,B0100,
B0010,B0000,B0000,B0100, 5,
B0001,B0000,B0000,B1000,
B0001,B0000,B0000,B1000, 5,
B0000,B0001,B1000,B0000,
B0000,B0001,B1000,B0000, 5,
B0000,B1000,B0001,B0000,
B0000,B1000,B0001,B0000, 5,
B1000,B0000,B0000,B0001,
B1000,B0000,B0000,B0001, 5,
// loop up and down full
B1111,B1111,B1111,B1111,
B0000,B0000,B0000,B0000, 10,
B0001,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 10,
B0001,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 10,
B0001,B0000,B0000,B0000,
B1111,B1111,B1111,B1111, 10,
B0001,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 10,
B0001,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 10,
B1111,B1111,B1111,B1111,
B0000,B0000,B0000,B0000, 10,

B0000,B0000,B0000,B000
B0000,B0110,B0110,B000
B0000,B0110,B0110,B000
B0000,B0110,B0110,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000

B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000
B0000,B0000,B0000,B000

B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
layer
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B1111,B1111,B1111,B1111, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B1111,B1111,B1111,B111
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B1111,B1111,B1111,B111
B1111,B1111,B1111,B1111, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000

B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000


0, B0000,B0000,B0000,B0000, 10,

1,
0,
0,
0,
0,
0,
1,

// loop left and right full layer


B0001,B0001,B0001,B0001, B0001,B0001,B0001,B0001,
B0001,B0001,B0001,B0001, 10,
B0010,B0010,B0010,B0010, B0010,B0010,B0010,B0010,
B0010,B0010,B0010,B0010, 10,
B0100,B0100,B0100,B0100, B0100,B0100,B0100,B0100,
B0100,B0100,B0100,B0100, 10,
B1000,B1000,B1000,B1000, B1000,B1000,B1000,B1000,
B1000,B1000,B1000,B1000, 10,
B0100,B0100,B0100,B0100, B0100,B0100,B0100,B0100,
B0100,B0100,B0100,B0100, 10,
B0010,B0010,B0010,B0010, B0010,B0010,B0010,B0010,
B0010,B0010,B0010,B0010, 10,
B0001,B0001,B0001,B0001, B0001,B0001,B0001,B0001,
B0001,B0001,B0001,B0001, 10,

B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0001,B0001,B0001,B0001,
1, B0001,B0001,B0001,B0001, 10,
B1001,B1001,B1001,B1001,
1, B1001,B1001,B1001,B1001, 10,
B1111,B1111,B1111,B1111,
1, B1001,B1001,B1001,B1001, 10,
B1111,B1111,B1111,B1111,
1, B1111,B1111,B1111,B1111, 10,
B1111,B1111,B1111,B1111,
1, B1111,B1111,B1111,B1111, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,

0,
1,
0,
1,
0,
1,
0,
1,
0,

B0010,B0010,B0010,B001
B0100,B0100,B0100,B010
B1000,B1000,B1000,B100
B0100,B0100,B0100,B010
B0010,B0010,B0010,B001
B0001,B0001,B0001,B000

B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0001,B0001,B0001,B0001, B0001,B0001,B0001,B000
B1001,B1001,B1001,B1001, B1001,B1001,B1001,B100
B1001,B1001,B1001,B1001, B1001,B1001,B1001,B100
B1001,B1001,B1001,B1001, B1001,B1001,B1001,B100
B1111,B1001,B1001,B1111, B1111,B1001,B1001,B111
B0000,B0110,B0110,B0000, B0000,B0110,B0110,B000

// outer cube, inner cube


B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000,
B0000,B0000,B0000,B0000, 10,
B1111,B1111,B1111,B1111, B1111,B1111,B1111,B1111,
B1111,B1111,B1111,B1111, 10,
B0000,B0000,B0000,B0000, B0000,B0110,B0110,B0000,
B0000,B0000,B0000,B0000, 10,
B1111,B1111,B1111,B1111, B1111,B1111,B1111,B1111,
B1111,B1111,B1111,B1111, 10,
B0000,B0000,B0000,B0000, B0000,B0110,B0110,B0000,
B0000,B0000,B0000,B0000, 10,
B1111,B1111,B1111,B1111, B1111,B1111,B1111,B1111,
B1111,B1111,B1111,B1111, 10,
B0000,B0000,B0000,B0000, B0000,B0110,B0110,B0000,
B0000,B0000,B0000,B0000, 10,
B1111,B1111,B1111,B1111, B1111,B1111,B1111,B1111,
B1111,B1111,B1111,B1111, 10,
B0000,B0000,B0000,B0000, B0000,B0110,B0110,B0000,
B0000,B0000,B0000,B0000, 10,

// circle layer by layer


B0000,B0000,B0100,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0110,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0010,B0110,B0000,

B0001,B0001,B0001,B000

B0000,B0000,B0000,B000
B1111,B1111,B1111,B111
B0000,B0110,B0110,B000
B1111,B1111,B1111,B111
B0000,B0110,B0110,B000
B1111,B1111,B1111,B111
B0000,B0110,B0110,B000
B1111,B1111,B1111,B111
B0000,B0110,B0110,B000

bottom to top
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000

0, B0000,B0000,B0000,B0000, 6,
B0000,B0110,B0110,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B1110,B0110,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B1110,B1110,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B1110,B1110,B1000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B1110,B1110,B1100,
0, B0000,B0000,B0000,B0000, 6,
B0000,B1110,B1110,B1110,
0, B0000,B0000,B0000,B0000, 6,
B0000,B1110,B1110,B1111,
0, B0000,B0000,B0000,B0000, 6,
B0000,B1110,B1111,B1111,
0, B0000,B0000,B0000,B0000, 6,
B0000,B1111,B1111,B1111,
0, B0000,B0000,B0000,B0000, 6,
B0001,B1111,B1111,B1111,
0, B0000,B0000,B0000,B0000, 6,
B0011,B1111,B1111,B1111,
0, B0000,B0000,B0000,B0000, 6,
B0111,B1111,B1111,B1111,
0, B0000,B0000,B0000,B0000, 6,
B1111,B1111,B1111,B1111,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,

B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0100,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0110,B0000, B0000,B0000,B0000,B000
B0000,B0010,B0110,B0000, B0000,B0000,B0000,B000
B0000,B0110,B0110,B0000, B0000,B0000,B0000,B000
B0000,B1110,B0110,B0000, B0000,B0000,B0000,B000
B0000,B1110,B1110,B0000, B0000,B0000,B0000,B000
B0000,B1110,B1110,B1000, B0000,B0000,B0000,B000
B0000,B1110,B1110,B1100, B0000,B0000,B0000,B000
B0000,B1110,B1110,B1110, B0000,B0000,B0000,B000
B0000,B1110,B1110,B1111, B0000,B0000,B0000,B000
B0000,B1110,B1111,B1111, B0000,B0000,B0000,B000
B0000,B1111,B1111,B1111, B0000,B0000,B0000,B000
B0001,B1111,B1111,B1111, B0000,B0000,B0000,B000
B0011,B1111,B1111,B1111, B0000,B0000,B0000,B000
B0111,B1111,B1111,B1111, B0000,B0000,B0000,B000
B1111,B1111,B1111,B1111, B0000,B0000,B0000,B000

B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
1, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
1, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
1, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
1, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
1, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
1, B0000,B0000,B0000,B0000, 6,
B0000,B0000,B0000,B0000,
1, B0000,B0000,B0000,B0000, 6,

B0000,B0000,B0000,B0000, B0000,B0000,B0100,B000

B0000,B0000,B0000,B0000,
0, B0000,B0000,B0100,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0110,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0010,B0110,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B0110,B0110,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B1110,B0110,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B1110,B1110,B0000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B1110,B1110,B1000, 6,
B0000,B0000,B0000,B0000,
0, B0000,B1110,B1110,B1100, 6,
B0000,B0000,B0000,B0000,
0, B0000,B1110,B1110,B1110, 6,
B0000,B0000,B0000,B0000,
0, B0000,B1110,B1110,B1111, 6,
B0000,B0000,B0000,B0000,
0, B0000,B1110,B1111,B1111, 6,
B0000,B0000,B0000,B0000,
0, B0000,B1111,B1111,B1111, 6,
B0000,B0000,B0000,B0000,
0, B0001,B1111,B1111,B1111, 6,

B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000

B0000,B0000,B0000,B0000, B0000,B0000,B0110,B000
B0000,B0000,B0000,B0000, B0000,B0010,B0110,B000
B0000,B0000,B0000,B0000, B0000,B0110,B0110,B000
B0000,B0000,B0000,B0000, B0000,B1110,B0110,B000
B0000,B0000,B0000,B0000, B0000,B1110,B1110,B000
B0000,B0000,B0000,B0000, B0000,B1110,B1110,B100
B0000,B0000,B0000,B0000, B0000,B1110,B1110,B110
B0000,B0000,B0000,B0000, B0000,B1110,B1110,B111
B0000,B0000,B0000,B0000, B0000,B1110,B1110,B111
B0000,B0000,B0000,B0000, B0000,B1110,B1111,B111
B0000,B0000,B0000,B0000, B0000,B1111,B1111,B111
B0000,B0000,B0000,B0000, B0001,B1111,B1111,B111
B0000,B0000,B0000,B0000, B0011,B1111,B1111,B111
B0000,B0000,B0000,B0000, B0111,B1111,B1111,B111
B0000,B0000,B0000,B0000, B1111,B1111,B1111,B111

B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000

B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000


0, B0011,B1111,B1111,B1111, 6,
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
0, B0111,B1111,B1111,B1111, 6,
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
0, B1111,B1111,B1111,B1111, 6,
B0001,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0011,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0011,B0010,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0011,B0011,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0110,B0110,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
1, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
1, B0000,B0000,B0001,B0011, 10,
B0000,B0000,B0000,B0000,
1, B0000,B0001,B0011,B0111, 10,
B0000,B0000,B0000,B0000,
1, B0000,B0011,B0111,B0111, 10,
B0000,B0000,B0000,B0000,
1, B0000,B0111,B0111,B0111, 10,
B0000,B0000,B0000,B0000,
0, B0000,B1110,B1110,B1110, 10,
B0000,B1110,B1110,B1110,
0, B0000,B0000,B0000,B0000, 10,
B0000,B1110,B1110,B1110,
0, B0000,B0000,B0000,B0000, 10,
B0000,B1110,B1110,B1110,
0, B0000,B0000,B0000,B0000, 10,
B0000,B1100,B1110,B1110,
0, B0000,B0000,B0000,B0000, 10,
B0000,B1000,B1100,B1110,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B1000,B1100,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B1000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B1000,B1000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B1000,B1000,B1000,
0, B0000,B0000,B0000,B0000, 10,
B1000,B1000,B1000,B1000,
0, B0000,B0000,B0000,B0000, 10,
B1100,B1000,B1000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B1110,B1000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B1110,B0000,B0000,B0000,

B0001,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0011,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0011,B0010,B0000,B0000, B0000,B0000,B0000,B000
B0011,B0011,B0000,B0000, B0000,B0000,B0000,B000
B0110,B0110,B0000,B0000, B0000,B0000,B0000,B000
B0110,B0110,B0000,B0000, B0110,B0110,B0000,B000
B0000,B0110,B0110,B0000, B0000,B0110,B0110,B000
B0000,B0000,B0110,B0110, B0000,B0000,B0110,B011
B0000,B0000,B0011,B0011, B0000,B0000,B0011,B001
B0000,B0001,B0011,B0111, B0000,B0001,B0011,B011
B0000,B0011,B0111,B0111, B0000,B0011,B0111,B011
B0000,B0111,B0111,B0111, B0000,B0111,B0111,B011
B0000,B0111,B0111,B0111, B0000,B0111,B0111,B011
B0000,B1110,B1110,B1110, B0000,B1110,B1110,B111
B0000,B1110,B1110,B1110, B0000,B1110,B1110,B111
B0000,B1110,B1110,B1110, B0000,B1100,B1110,B111
B0000,B1100,B1110,B1110, B0000,B1000,B1100,B111
B0000,B1000,B1100,B1110, B0000,B0000,B1000,B110
B0000,B0000,B1000,B1100, B0000,B0000,B0000,B100
B0000,B0000,B0000,B1000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0010,B0000,B0000,B0000, B0000,B0000,B0000,B000

0, B0000,B0000,B0000,B0000, 10,
B0110,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0010,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0001,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0011,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0111,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B1111,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B1110,B1000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B1100,B1100,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B1000,B1110,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B1111,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0111,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0011,B0000,B0000, 10,
B0000,B0001,B0000,B0000,
0, B0000,B0001,B0000,B0000, 10,
B0001,B0001,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0011,B0001,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0111,B0001,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B1111,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B1111,B1000,B0000,B0000,

B0011,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0011,B0001,B0000,B0000, B0000,B0000,B0000,B000
B0011,B0001,B0001,B0000, B0000,B0000,B0000,B000
B0001,B0001,B0001,B0001, B0000,B0000,B0000,B000
B0000,B0001,B0001,B0011, B0000,B0000,B0000,B000
B0000,B0000,B0001,B0111, B0000,B0000,B0000,B000
B0000,B0000,B0000,B1111, B0000,B0000,B0000,B000
B0000,B0000,B0000,B1110, B0000,B0000,B0000,B100
B0000,B0000,B0000,B1100, B0000,B0000,B1000,B100
B0000,B0000,B0000,B1000, B0000,B0000,B1100,B100
B0000,B0000,B0000,B0000, B0000,B0000,B1110,B100
B0000,B0000,B0000,B0000, B0000,B0000,B1111,B000
B0000,B0000,B0000,B0000, B0000,B0001,B0111,B000
B0000,B0000,B0000,B0000, B0001,B0001,B0011,B000
B0000,B0000,B0000,B0000, B0001,B0001,B0001,B000
B0000,B0000,B0000,B0000, B0001,B0001,B0000,B000
B0000,B0000,B0000,B0000, B0001,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0001,B0000,B000
B0000,B0001,B0000,B0000, B0000,B0001,B0000,B000
B0000,B0001,B0000,B0000, B0000,B0001,B0000,B000
B0000,B0001,B0000,B0000, B0000,B0001,B0000,B000
B0000,B0001,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000

0, B0000,B0000,B0000,B0000, 10,
B1111,B1100,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B1111,B1110,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B1111,B1111,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B1111,B1111,B0001,B0000,
0, B0000,B0000,B0000,B0000, 10,
B1111,B1111,B0011,B0000,
0, B0000,B0000,B0000,B0000, 10,
B1111,B1111,B0111,B0000,
0, B0000,B0000,B0000,B0000, 10,
B1111,B1111,B1111,B0000,
0, B0000,B0000,B0000,B0000, 10,
B1111,B1111,B1111,B1000,
0, B0000,B0000,B0000,B0000, 10,
B1111,B1111,B1111,B1100,
0, B0000,B0000,B0000,B0000, 10,
B1111,B1111,B1111,B1110,
0, B0000,B0000,B0000,B0000, 10,
B1111,B1111,B1111,B1111,
0, B0000,B0000,B0000,B0000, 10,
B1111,B1111,B1111,B1111,
0, B0000,B0000,B0000,B0000, 10,
B0111,B0111,B0111,B0111,
0, B0000,B0000,B0000,B0000, 10,
B0011,B0011,B0011,B0011,
0, B0000,B0000,B0000,B0000, 10,
B0001,B0001,B0001,B0001,
0, B1000,B1000,B1000,B1000, 10,
B0001,B0001,B0001,B0001,
0, B0100,B0100,B0100,B0100, 10,
B0001,B0001,B0001,B0001,
1, B0010,B0010,B0010,B0010, 10,
B0001,B0001,B0001,B0001,
1, B0001,B0001,B0001,B0001, 10,
B0010,B0001,B0001,B0001,
1, B0010,B0001,B0001,B0001, 10,
B0100,B0010,B0001,B0001,
1, B0100,B0010,B0001,B0001, 10,
B1000,B0100,B0010,B0001,
1, B1000,B0100,B0010,B0001, 10,
B0000,B1100,B0011,B0000,
0, B0000,B1100,B0011,B0000, 10,
B0000,B0011,B1100,B0000,
0, B0000,B0011,B1100,B0000, 10,
B0001,B0010,B0100,B1000,
0, B0001,B0010,B0100,B1000, 10,
B0010,B0010,B0100,B0100,
0, B0010,B0010,B0100,B0100, 10,
B0100,B0100,B0010,B0010,
0, B0100,B0100,B0010,B0010, 10,
B1000,B0100,B0010,B0001,
1, B1000,B0100,B0010,B0001, 10,
B0000,B1100,B0011,B0000,
0, B0000,B1100,B0011,B0000, 10,
B0000,B0011,B1100,B0000,
0, B0000,B0011,B1100,B0000, 10,
B0001,B0010,B0100,B1000,

B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B1000,B1000,B1000,B1000, B0000,B0000,B0000,B000
B0100,B0100,B0100,B0100, B1000,B1000,B1000,B100
B0010,B0010,B0010,B0010, B0100,B0100,B0100,B010
B0001,B0001,B0001,B0001, B0010,B0010,B0010,B001
B0001,B0001,B0001,B0001, B0001,B0001,B0001,B000
B0001,B0001,B0001,B0001, B0001,B0001,B0001,B000
B0010,B0001,B0001,B0001, B0010,B0001,B0001,B000
B0100,B0010,B0001,B0001, B0100,B0010,B0001,B000
B1000,B0100,B0010,B0001, B1000,B0100,B0010,B000
B0000,B1100,B0011,B0000, B0000,B1100,B0011,B000
B0000,B0011,B1100,B0000, B0000,B0011,B1100,B000
B0001,B0010,B0100,B1000, B0001,B0010,B0100,B100
B0010,B0010,B0100,B0100, B0010,B0010,B0100,B010
B0100,B0100,B0010,B0010, B0100,B0100,B0010,B001
B1000,B0100,B0010,B0001, B1000,B0100,B0010,B000
B0000,B1100,B0011,B0000, B0000,B1100,B0011,B000
B0000,B0011,B1100,B0000, B0000,B0011,B1100,B000
B0001,B0010,B0100,B1000, B0001,B0010,B0100,B100

0, B0001,B0010,B0100,B1000, 10,
B1000,B0100,B0010,B0001,
1, B1000,B0100,B0010,B0001, 10,
B0000,B1100,B0011,B0000,
0, B0000,B1100,B0011,B0000, 10,
B0000,B0011,B1100,B0000,
0, B0000,B0011,B1100,B0000, 10,
B0001,B0010,B0100,B1000,
0, B0001,B0010,B0100,B1000, 10,
B0010,B0010,B0100,B0100,
0, B0010,B0010,B0100,B0100, 10,
B0100,B0100,B0010,B0010,
0, B0100,B0100,B0010,B0010, 10,
B1000,B0100,B0010,B0001,
1, B1000,B0100,B0010,B0001, 10,
B0000,B1100,B0011,B0000,
0, B0000,B1100,B0011,B0000, 8,
B0000,B0011,B1100,B0000,
0, B0000,B0011,B1100,B0000, 8,
B0001,B0010,B0100,B1000,
0, B0001,B0010,B0100,B1000, 8,
B1000,B0100,B0010,B0001,
1, B1000,B0100,B0010,B0001, 8,
B0000,B1100,B0011,B0000,
0, B0000,B1100,B0011,B0000, 8,
B0000,B0011,B1100,B0000,
0, B0000,B0011,B1100,B0000, 8,
B0001,B0010,B0100,B1000,
0, B0001,B0010,B0100,B1000, 8,
B0010,B0010,B0100,B0100,
0, B0010,B0010,B0100,B0100, 8,
B0100,B0100,B0010,B0010,
0, B0100,B0100,B0010,B0010, 8,
B1000,B0100,B0010,B0001,
1, B1000,B0100,B0010,B0001, 8,
B0000,B1100,B0011,B0000,
0, B0000,B1100,B0011,B0000, 8,
B0000,B0011,B1100,B0000,
0, B0000,B0011,B1100,B0000, 8,
B0001,B0010,B0100,B1000,
0, B0001,B0010,B0100,B1000, 8,
B1000,B0100,B0010,B0001,
1, B1000,B0100,B0010,B0001, 8,
B0000,B1100,B0011,B0000,
0, B0000,B1100,B0011,B0000, 7,
B0000,B0011,B1100,B0000,
0, B0000,B0011,B1100,B0000, 7,
B0001,B0010,B0100,B1000,
0, B0001,B0010,B0100,B1000, 7,
B0010,B0010,B0100,B0100,
0, B0010,B0010,B0100,B0100, 7,
B0100,B0100,B0010,B0010,
0, B0100,B0100,B0010,B0010, 7,
B1000,B0100,B0010,B0001,
1, B1000,B0100,B0010,B0001, 7,
B0000,B1100,B0011,B0000,
0, B0000,B1100,B0011,B0000, 7,
B0000,B0011,B1100,B0000,
0, B0000,B0011,B1100,B0000, 7,
B0001,B0010,B0100,B1000,

B1000,B0100,B0010,B0001, B1000,B0100,B0010,B000
B0000,B1100,B0011,B0000, B0000,B1100,B0011,B000
B0000,B0011,B1100,B0000, B0000,B0011,B1100,B000
B0001,B0010,B0100,B1000, B0001,B0010,B0100,B100
B0010,B0010,B0100,B0100, B0010,B0010,B0100,B010
B0100,B0100,B0010,B0010, B0100,B0100,B0010,B001
B1000,B0100,B0010,B0001, B1000,B0100,B0010,B000
B0000,B1100,B0011,B0000, B0000,B1100,B0011,B000
B0000,B0011,B1100,B0000, B0000,B0011,B1100,B000
B0001,B0010,B0100,B1000, B0001,B0010,B0100,B100
B1000,B0100,B0010,B0001, B1000,B0100,B0010,B000
B0000,B1100,B0011,B0000, B0000,B1100,B0011,B000
B0000,B0011,B1100,B0000, B0000,B0011,B1100,B000
B0001,B0010,B0100,B1000, B0001,B0010,B0100,B100
B0010,B0010,B0100,B0100, B0010,B0010,B0100,B010
B0100,B0100,B0010,B0010, B0100,B0100,B0010,B001
B1000,B0100,B0010,B0001, B1000,B0100,B0010,B000
B0000,B1100,B0011,B0000, B0000,B1100,B0011,B000
B0000,B0011,B1100,B0000, B0000,B0011,B1100,B000
B0001,B0010,B0100,B1000, B0001,B0010,B0100,B100
B1000,B0100,B0010,B0001, B1000,B0100,B0010,B000
B0000,B1100,B0011,B0000, B0000,B1100,B0011,B000
B0000,B0011,B1100,B0000, B0000,B0011,B1100,B000
B0001,B0010,B0100,B1000, B0001,B0010,B0100,B100
B0010,B0010,B0100,B0100, B0010,B0010,B0100,B010
B0100,B0100,B0010,B0010, B0100,B0100,B0010,B001
B1000,B0100,B0010,B0001, B1000,B0100,B0010,B000
B0000,B1100,B0011,B0000, B0000,B1100,B0011,B000
B0000,B0011,B1100,B0000, B0000,B0011,B1100,B000
B0001,B0010,B0100,B1000, B0001,B0010,B0100,B100

0, B0001,B0010,B0100,B1000, 7,
B1000,B0100,B0010,B0001,
1, B1000,B0100,B0010,B0001, 7,
B0000,B1100,B0011,B0000,
0, B0000,B1100,B0011,B0000, 6,
B0000,B0011,B1100,B0000,
0, B0000,B0011,B1100,B0000, 6,
B0001,B0010,B0100,B1000,
0, B0001,B0010,B0100,B1000, 6,
B0010,B0010,B0100,B0100,
0, B0010,B0010,B0100,B0100, 6,
B0100,B0100,B0010,B0010,
0, B0100,B0100,B0010,B0010, 6,
B1000,B0100,B0010,B0001,
1, B1000,B0100,B0010,B0001, 6,
B0000,B1100,B0011,B0000,
0, B0000,B1100,B0011,B0000, 6,
B0000,B0011,B1100,B0000,
0, B0000,B0011,B1100,B0000, 6,
B0100,B0100,B0010,B0010,
0, B0100,B0100,B0010,B0010, 6,
B1000,B0100,B0010,B0001,
1, B1000,B0100,B0010,B0001, 6,
B0000,B1100,B0011,B0000,
0, B0000,B1100,B0011,B0000, 6,
B0000,B0011,B1100,B0000,
0, B0000,B0011,B1100,B0000, 6,
B0001,B0010,B0100,B1000,
0, B0001,B0010,B0100,B1000, 6,
B1000,B0100,B0010,B0001,
1, B1000,B0100,B0010,B0001, 6,
B0000,B1100,B0011,B0000,
0, B0000,B1100,B0011,B0000, 5,
B0000,B0011,B1100,B0000,
0, B0000,B0011,B1100,B0000, 5,
B0001,B0010,B0100,B1000,
0, B0001,B0010,B0100,B1000, 5,
B0010,B0010,B0100,B0100,
0, B0010,B0010,B0100,B0100, 5,
B0100,B0100,B0010,B0010,
0, B0100,B0100,B0010,B0010, 5,
B1000,B0100,B0010,B0001,
1, B1000,B0100,B0010,B0001, 5,
B0000,B1100,B0011,B0000,
0, B0000,B1100,B0011,B0000, 5,
B0000,B0011,B1100,B0000,
0, B0000,B0011,B1100,B0000, 10,
B0001,B0010,B0100,B1000,
0, B0001,B0010,B0100,B1000, 10,
B0000,B0010,B0100,B0000,
0, B0001,B0010,B0100,B1000, 10,
B0000,B0000,B0000,B0000,
0, B0001,B0010,B0100,B1000, 10,
B0000,B0000,B0000,B0000,
0, B0001,B0010,B0100,B1000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0010,B0100,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,

B1000,B0100,B0010,B0001, B1000,B0100,B0010,B000
B0000,B1100,B0011,B0000, B0000,B1100,B0011,B000
B0000,B0011,B1100,B0000, B0000,B0011,B1100,B000
B0001,B0010,B0100,B1000, B0001,B0010,B0100,B100
B0010,B0010,B0100,B0100, B0010,B0010,B0100,B010
B0100,B0100,B0010,B0010, B0100,B0100,B0010,B001
B1000,B0100,B0010,B0001, B1000,B0100,B0010,B000
B0000,B1100,B0011,B0000, B0000,B1100,B0011,B000
B0000,B0011,B1100,B0000, B0000,B0011,B1100,B000
B0100,B0100,B0010,B0010, B0100,B0100,B0010,B001
B1000,B0100,B0010,B0001, B1000,B0100,B0010,B000
B0000,B1100,B0011,B0000, B0000,B1100,B0011,B000
B0000,B0011,B1100,B0000, B0000,B0011,B1100,B000
B0001,B0010,B0100,B1000, B0001,B0010,B0100,B100
B1000,B0100,B0010,B0001, B1000,B0100,B0010,B000
B0000,B1100,B0011,B0000, B0000,B1100,B0011,B000
B0000,B0011,B1100,B0000, B0000,B0011,B1100,B000
B0001,B0010,B0100,B1000, B0001,B0010,B0100,B100
B0010,B0010,B0100,B0100, B0010,B0010,B0100,B010
B0100,B0100,B0010,B0010, B0100,B0100,B0010,B001
B1000,B0100,B0010,B0001, B1000,B0100,B0010,B000
B0000,B1100,B0011,B0000, B0000,B1100,B0011,B000
B0000,B0011,B1100,B0000, B0000,B0011,B1100,B000
B0001,B0010,B0100,B1000, B0001,B0010,B0100,B100
B0001,B0010,B0100,B1000, B0001,B0010,B0100,B100
B0000,B0010,B0100,B0000, B0001,B0010,B0100,B100
B0000,B0000,B0000,B0000, B0000,B0010,B0100,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000

B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B1000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0010,B0000,B1000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0010,B1000,B0000, 10,
B0000,B0000,B0000,B1000,
0, B0000,B0000,B1000,B0000, 10,
B0000,B0010,B0000,B1000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0010,B1000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B1000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0100,B0010,B0000,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0110,B0110,B0000,
0, B0000,B0000,B0000,B0000, 10,
B1001,B0110,B0110,B1001,
0, B0000,B0000,B0000,B0000, 10,
B1101,B0111,B1110,B1011,
0, B0000,B0100,B0010,B0000, 10,
B1111,B1111,B1111,B1111,
1, B0000,B0110,B0110,B0000, 10,
B1111,B1111,B1111,B1111,
1, B1001,B0110,B0110,B1001, 10,
B1111,B1111,B1111,B1111,
1, B1101,B0111,B1110,B1011, 10,
B1111,B1111,B1111,B1111,
1, B1111,B1111,B1111,B1111, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,
B1111,B1111,B1111,B1111,
1, B1111,B1111,B1111,B1111, 10,
B1111,B1111,B1111,B1111,
1, B0000,B0000,B0000,B0000, 10,
B1111,B1111,B1111,B1111,
0, B0000,B0000,B0000,B0000, 10,
B1111,B1111,B1111,B1111,
0, B0000,B0000,B0000,B0000, 10,
B0000,B0000,B0000,B0000,
0, B0000,B0000,B0000,B0000, 10,

B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B100
B0000,B0000,B0000,B1000, B0000,B0010,B0000,B100
B0000,B0010,B0000,B1000, B0000,B0010,B1000,B000
B0000,B0010,B1000,B0000, B0000,B0000,B1000,B000
B0000,B0000,B1000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0100,B0010,B0000, B0000,B0000,B0000,B000
B0000,B0110,B0110,B0000, B0000,B0100,B0010,B000
B1001,B0110,B0110,B1001, B0000,B0110,B0110,B000
B1101,B0111,B1110,B1011, B1001,B0110,B0110,B100
B1111,B1111,B1111,B1111, B1101,B0111,B1110,B101
B1111,B1111,B1111,B1111, B1111,B1111,B1111,B111
B1111,B1111,B1111,B1111, B1111,B1111,B1111,B111
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B1111,B1111,B1111,B1111, B1111,B1111,B1111,B111
B1111,B1111,B1111,B1111, B1111,B1111,B1111,B111
B1111,B1111,B1111,B1111, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000
B0000,B0000,B0000,B0000, B0000,B0000,B0000,B000

// this is a dummy element for end of table (duration=0) aka !!!DO NOT TOUCH!!!
B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B0000, B00
00, B0000, B0000, B0000, B0000, 0
};
/*
**
**
**
**
*/

Defining pins in array makes it easier to rearrange how cube is wired


Adjust numbers here until LEDs flash in order - L to R, T to B
Note that analog inputs 0-5 are also digital outputs 14-19!
Pin DigitalOut0 (serial RX) and AnalogIn5 are left open for future apps

int LEDPin[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};


int PlanePin[] = {16, 17, 18, 19};

// initialization
void setup()
{
int pin; // loop counter
// set up LED pins as output (active HIGH)
for (pin=0; pin<PLANESIZE; pin++) {
pinMode( LEDPin[pin], OUTPUT );
}
// set up plane pins as outputs (active LOW)
for (pin=0; pin<CUBESIZE; pin++) {
pinMode( PlanePin[pin], OUTPUT );
}
}
// display pattern in table until DisplayTime is zero (then repeat)
void loop()
{
// declare variables
byte PatternBuf[PLANESIZE]; // saves current pattern from PatternTable
int PatternIdx;
byte DisplayTime; // time*100ms to display pattern
unsigned long EndTime;
int plane; // loop counter for cube refresh
int patbufidx; // indexes which byte from pattern buffer
int ledrow; // counts LEDs in refresh loop
int ledcol; // counts LEDs in refresh loop
int ledpin; // counts LEDs in refresh loop
// Initialize PatternIdx to beginning of pattern table
PatternIdx = 0;
// loop over entries in pattern table - while DisplayTime>0
do {
// read pattern from PROGMEM and save in array
memcpy_P( PatternBuf, PatternTable+PatternIdx, PLANESIZE );
PatternIdx += PLANESIZE;
// read DisplayTime from PROGMEM and increment index
DisplayTime = pgm_read_byte_near( PatternTable + PatternIdx++ );
// compute EndTime from current time (ms) and DisplayTime
EndTime = millis() + ((unsigned long) DisplayTime) * TIMECONST;
// loop while DisplayTime>0 and current time < EndTime
while ( millis() < EndTime ) {
patbufidx = 0; // reset index counter to beginning of buffer
// loop over planes
for (plane=0; plane<CUBESIZE; plane++) {
// turn previous plane off
if (plane==0) {
digitalWrite( PlanePin[CUBESIZE-1], HIGH );
} else {
digitalWrite( PlanePin[plane-1], HIGH );
}
// load current plane pattern data into ports
ledpin = 0;
for (ledrow=0; ledrow<CUBESIZE; ledrow++) {
for (ledcol=0; ledcol<CUBESIZE; ledcol++) {
digitalWrite( LEDPin[ledpin++], PatternBuf[patbufidx] & (1 << ledcol) );
}
patbufidx++;

}
// turn current plane on
digitalWrite( PlanePin[plane], LOW );
// delay PLANETIME us
delayMicroseconds( PLANETIME );
} // for plane
} // while <EndTime
} while (DisplayTime > 0); // read patterns until time=0 which signals end
}