I bet you haven't been here...
http://www.mushroo.me/home/voxel-shield/voxel-shield-overviewSome code I wrote for individual xyz LED control.
// Shift Register pin assignments
int dataPin = 2;
int clockPin = 3;
int latchPin = 5;
int masterClear = 4;
void led(int x,int y,int z,int hold){
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, 0b00000001 << z);
if(y == 7){
shiftOut(dataPin, clockPin, MSBFIRST, 0b00000001 << x);
} else {
shiftOut(dataPin, clockPin, MSBFIRST, 0b00000000);
}
if(y == 6){
shiftOut(dataPin, clockPin, MSBFIRST, 0b00000001 << x);
} else {
shiftOut(dataPin, clockPin, MSBFIRST, 0b00000000);
}
if(y == 5){
shiftOut(dataPin, clockPin, MSBFIRST, 0b00000001 << x);
} else {
shiftOut(dataPin, clockPin, MSBFIRST, 0b00000000);
}
if(y == 4){
shiftOut(dataPin, clockPin, MSBFIRST, 0b00000001 << x);
} else {
shiftOut(dataPin, clockPin, MSBFIRST, 0b00000000);
}
if(y == 3){
shiftOut(dataPin, clockPin, MSBFIRST, 0b00000001 << x);
} else {
shiftOut(dataPin, clockPin, MSBFIRST, 0b00000000);
}
if(y == 2){
shiftOut(dataPin, clockPin, MSBFIRST, 0b00000001 << x);
} else {
shiftOut(dataPin, clockPin, MSBFIRST, 0b00000000);
}
if(y == 1){
shiftOut(dataPin, clockPin, MSBFIRST, 0b00000001 << x);
} else {
shiftOut(dataPin, clockPin, MSBFIRST, 0b00000000);
}
if(y == 0){
shiftOut(dataPin, clockPin, MSBFIRST, 0b00000001 << x);
} else {
shiftOut(dataPin, clockPin, MSBFIRST, 0b00000000);
}
digitalWrite(latchPin, HIGH);
delay(hold);
}
void clean(int hold){
digitalWrite(latchPin, LOW);
for(int x = 0;x < 10;x++){
shiftOut(dataPin, clockPin, MSBFIRST, 0b00000000);
}
digitalWrite(latchPin, HIGH);
delay(hold);
}
void setup() {
// Setup the pin modes
pinMode(dataPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(latchPin, OUTPUT);
pinMode(masterClear, OUTPUT);
// Clear the shift registers
digitalWrite(masterClear, LOW);
delay(10);
digitalWrite(masterClear, HIGH);
}
void loop() {
// x,y,z,delay
led(0,0,0,100); //top left, bottom layer
led(1,0,0,100); //top +1 left
led(2,0,0,100); //top +2 left
led(3,0,0,100); //top +3 left
led(4,0,0,100); //top +4 left
led(5,0,0,100); //top +5 left
led(6,0,0,100); //top +6 left
led(7,0,0,100); //top +7 left
// delay
clean(100);
}
I'm currently building my cube, here is some thumbnails:












