I am very confused. Just playing around with some simple code and some TLC5940s on a demo shield.
/* For the RGB 4x4 board, with 3 TLC5940 */
#include <Tlc5940.h>
const byte WP[] = // winding path
{ 0, 1, 2, 3, 7, 11, 15, 14, 10, 6, 5, 9, 13, 12, 8, 4 } ;
void setup() {
Tlc.init() ;
Serial.begin(9600);
setchn() ; // set up channles
Tlc.update(); Serial.println("X"); // now send it out
}
void loop() {
}
void setchn() {
// load the current array
for (byte C=0; C<=32; C +=16) // for each colur
for ( byte n=0; n<16; n++) { // for each element
Tlc.set(WP[n]+C,32-n*2) ; // load a value
Serial.print("."); // comment out for code to fail??
}
}
This works.
If the last line with
Serial.print("."); is commented out, the LEDs remain dark. It is af the
Tlc.set() is only called if the Serial is there.
I have discovered that if I change it from SPI mode to BitBang mode (
#define DATA_TRANSFER_MODE) in the library I get even weirder results. I have a tiny "hello world"-like program which works without the Serial.
W-T-F ?? I just can't see my error.