3x3x3 led cube.

So I wasn’t sure if I should put this is the multiplexing section or the programming section.

My question is regarding arrays. I just made an led cube and switched the programming to an array based system. However, when I did this the leds began to start dimming. Layer 0 for some reason is really dim, where as layer 2 is very bright. I didn’t have this problem when I listed out the variables. When I listed out each variable it was still dim, but it was an even amount of brightness through all of the leds. Now each layer varies in brightness. I am sure it is very simple , but I am a total Noob at this.

int const time = 1;
int Column[]={0,1,2,3,4,5,6,7,8};
int Layer[]={11,12,13};
int columnCount = 9;
int layerCount = 3;

void setup(){
for(int i = 0; i<columnCount;i++){
    pinMode(Column[i], OUTPUT);

  for(int i = 0 ; i<layerCount;i++){


//Shuts all of the leds off

void AllOff(){
 for(int i=0; i<columnCount; i++){

void AllOn(){

  for(int i=0; i<columnCount; i++){
  for(int i=0; i<layerCount;i++){


void loop(){

Moderator edit: sketch rendered legible

What is connected to the column pins? What is connected to the layer pins? Typically, you’d have anodes connected to one set of pins, and cathodes connected to the other.

Each layer has a common cathode connect to transistors so I can turn the layers on and off. Each column has a common anode.

I got it working! It was just a coincidental hardware failure.