For some time now I have been working on a 888 RGB led cube. The only problem is that when ever I try to switch a large number of the red LED's on I get random LED's lighting up. I will say that the chip's that run the red LED's are at the start of the data chain (Sin). I have tried swapping the drivers, checking the wiring and a few other things. I am using a arduino nano.
code: (note that I have only been working with one layer)
#include "SparkFun_Tlc5940.h"
void setup()
{
Serial.begin(9600);
Tlc.init();
}
void loop()
{
Tlc.clear();
delay(1000);
Random("G",100,10);
Random("RGB",100,10);
Random("R",100,10);
Random("GB",100,10);
Random("B",100,10);
Random("RG",100,10);
//fill_slide("R",1000);
}
void Random(String type, int times, int delay_time) {
int direction = 1;
int channel = 0, first = 0, last = 0;
if(type == "R"){
first = 0;
last = 64;
}else if(type == "G"){
first = 65;
last = 128;
}else if(type == "B"){
first = 129;
last = 192;
}else if(type == "RG"){
first = 0;
last = 128;
}else if(type == "GB"){
first = 65;
last = 192;
}else if(type == "RGB"){
first = 0;
last = 192;
}
Tlc.clear();
for (int count = 0; count <= times; count ++) {
Tlc.set(random(first, last), 500);
Tlc.update();
delay(delay_time);
}
}
TLC5940 Datasheet - http://www.ti.com/lit/ds/symlink/tlc5940.pdf
TLC5940 Library - GitHub - sparkfun/SparkFun_TLC5940_Arduino_Library: Library for the TLC5940
Thanks,
Eli