I'm still quite new to arduino and electronics in general, so please bear with me. I'm working on a project with over a hundred LEDs using an Arduino Uno and many TLC5940's. I know many, many novices have started posts like this with overly ambitious LED projects, but this one is actually very simple - because only a couple LEDs will ever be on at the same time. All I need to figure out at this point is how to individually control each LEDs so that they are either either on, off, or fading on/off at different times.
For the life of me I haven't been able to accomplish this. I'm using the library from Sparkfun's website. My setup is exactly like the schematic here: http://tronixstuff.BANNED.com/2010/0 ... r%C2%A0ic/ .
The problem I'm running into is that the LED's do not turn off when they should, in a somewhat unpredictable manner. If I run the code below, the first two LED's WILL turn off, but the remaining four will stay dimly lit. If I play with the timings then different ones will remain dimly lit. Something basic must be very wrong or missing...
Code: Select all
#include "Tlc5940.h" //led driver
#include "tlc_fades.h"
void setup ()
{
Tlc.init ();
{
tlc_addFade (0, 0, 500, 1000, 3000); tlc_addFade (0, 500, 0, 2750, 3000);
tlc_addFade (1, 0, 500, 1000, 3000); tlc_addFade (1, 500, 0, 2750, 3000);
tlc_addFade (2, 0, 500, 1000, 3000); tlc_addFade (2, 500, 0, 2750, 4000);
tlc_addFade (3, 0, 500, 1000, 3000); tlc_addFade (3, 500, 0, 2750, 4000);
tlc_addFade (4, 0, 500, 1000, 3000); tlc_addFade (4, 500, 0, 2750, 4000);
tlc_addFade (5, 0, 500, 1000, 3000); tlc_addFade (5, 500, 0, 2750, 4000);
}
}
void loop ()
{
tlc_updateFades ();
}