Finally made some progress with the LED cube, now the multiplexing is more or less working, as you can see from the picture there are different colors on each column:

The code is a very manual and basic way of doing things however it demonstrates a principal:

#include "Tlc5940.h"

int layer1[48];

int layer2[48];

int layer3[48];

int layer4[48];

word interval=100;

int startTime;

void setup()

{

Tlc.init();  

pinMode(5,OUTPUT);

pinMode(6,OUTPUT);

pinMode(7,OUTPUT);

pinMode(8,OUTPUT);

   digitalWrite(5,HIGH);

   digitalWrite(6,HIGH);

   digitalWrite(7,HIGH);

   digitalWrite(8,HIGH); 

     for (int i = 0;i<47;i++)

{

  layer1[i]= random(100,4000);

  layer2[i]= random(100,4000);

  layer3[i]= random(100,4000);

  layer4[i]= random(100,4000);

}

}

void loop()

{

   digitalWrite(8,HIGH); 

  for (int i = 0;i<47;i++)

{

 Tlc.set(i,layer1[i]);

}

  Tlc.update();

  startTime = micros();

    digitalWrite(5,LOW); 

while(micros() < (startTime + interval)){}

startTime = micros();

   digitalWrite(5,HIGH); 

  for (int i = 0;i<47;i++)

{

 Tlc.set(i,layer1[i]);

}

  Tlc.update();

  startTime = micros();

    digitalWrite(6,LOW); 

while(micros() < (startTime + interval)){}

startTime = micros();

   digitalWrite(6,HIGH); 

  for (int i = 0;i<47;i++)

{

 Tlc.set(i,layer1[i]);

}

  Tlc.update();

  startTime = micros();

    digitalWrite(7,LOW); 

while(micros() < (startTime + interval)){}

startTime = micros();

   digitalWrite(7,HIGH); 

  for (int i = 0;i<47;i++)

{

 Tlc.set(i,layer1[i]);

}

  Tlc.update();

  startTime = micros();

    digitalWrite(8,LOW); 

while(micros() < (startTime + interval)){}

startTime = micros();

}

Comment