The schematic is in attachments.
The dimensions of cube are now of 8x8x8.
On the internet I found a 8x8x8 RGB code, the problem is, it is for a RGB cube, but I have modified to remove the part of "RGB".
The goal that I want to get is this:
//There are 512 LEDs in the cube, so when we write to level 2, column 5, row 4, that needs to be translated into a number from 0 to 511
//This looks confusing, I know...
int whichbyte = int(((level64)+(row8)+column)/8);
// The first level LEDs are first in the sequence, then 2nd level, then third, and so on
//the (level*64) is what indexes the level's starting place, so level 0 are LEDs 0-63, level 1 are LEDs 64-127, and so on
//The column counts left to right 0-7 and the row is back to front 0-7
//This means that if you had level 0, row 0, the bottom back row would count from 0-7,
//so if you looked down on the cube, and only looked at the bottom level
// 00 01 02 03 04 05 06 07
// 08 09 10 11 12 13 14 15
// 16 17 18 19 20 21 22 23
// 24 25 26 27 28 29 30 31
// 32 33 34 35 36 37 38 39
// 40 41 42 43 44 45 46 47
// 48 49 50 51 52 53 54 55
// 56 57 58 59 60 61 62 63
//Then, if you incremented the level, the top right of the grid above would start at 64
//The reason for doing this, is so you don't have to memorize a number for each LED, allowing you to use level, row, column
//Now, what about the divide by 8 in there?
//...well, we have 8 bits per byte, and we have 64 bytes in memory for all 512 bits needed for each LED, so
//we divide the number we just found by 8, and take the integ7er of it, so we know which byte, that bit is located
//confused? that's ok, let's take an example, if we wanted to write to the LED to the last LED in the cube, we would write a 7, 7, 7
// giving (764)+(78)=7 = 511, which is right, but now let's divide it by 8, 511/8 = 63.875, and take the int of it so, we get 63,
//this is the last byte in the array, which is right since this is the last LED
// This next variable is the same thing as before, but here we don't divide by 8, so we get the LED number 0-511
int wholebyte=(level64)+(row8)+column;
//This will all make sense in a sec
//Are you now more confused? You shouldn't be! It's starting to make sense now. Notice how each line is a bitWrite, which is,
//bitWrite(the byte you want to write to, the bit of the byte to write, and the 0 or 1 you want to write)
//This means that the 'whichbyte' is the byte from 0-63 in which the bit corresponding to the LED from 0-511
//Is making sense now why we did that? taking a value from 0-511 and converting it to a value from 0-63, since each LED represents a bit in
//an array of 64 bytes.
//Then next line is which bit 'wholebyte-(8whichbyte)'
//This is simply taking the LED's value of 0-511 and subracting it from the BYTE its bit was located in times 8
//Think about it, byte 63 will contain LEDs from 504 to 511, so if you took 505-(863), you get a 1, meaning that,
//LED number 505 is is located in bit 1 of byte 63 in the array
//is that it? No, you still have to do the bitRead of the brightness 0-15 you are trying to write,
//if you wrote a 15 to RED, all 4 arrays for that LED would have a 1 for that bit, meaning it will be on 100%
//This is why the four arrays read 0-4 of the value entered in for RED, GREEN, and BLUE
//hopefully this all makes some sense?
To multiplex the connections, I used 8 and one 74HC574 IC 74HC138. Integrated circuits aka Shift registers in This Project.