Pages: [1]   Go Down
Author Topic: TLC5940 and individual LED control  (Read 482 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello everyone!

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.wordpress.com/2010/07/19/review-%E2%80%93-texas-instruments-tlc5940-16-channel-led-driver%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:
#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 ();
}

Thank you in advance!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Going off of the site site below, I'll try buying some decoupling capacitors:

http://arduino.cc/forum/index.php?PHPSESSID=2ad6483bc4f6fa78406acd64a2406621&topic=134953.0

EDIT:

I scavenged a 0.1uF and a 47uF from some old parts. I put the 0.1 between the vcc and gnd of the TLC5940 and the 47 between the gnd of the TLC5940 and the 5v power rail on the breadboard. Short legs on all.

I've been playing with lots of different combinations for the timing, but I still sometimes get a dimly glowing LED at the end of the row of LEDs. All of the LEDs will go through their fading routine as they should, but usually at least one will stay dimly lit when it should be off.
« Last Edit: March 23, 2013, 05:46:26 pm by jetjaguar » Logged

Pages: [1]   Go Up
Jump to: