Arduino Forum

Using Arduino => LEDs and Multiplexing => Topic started by: cl10Greg on May 17, 2011, 04:28 am

Title: Tlc5940 multiplexing code
Post by: cl10Greg on May 17, 2011, 04:28 am
Hello again,

I have two rows of 4 RGB Led's.  The anodes are powered with P-Fet's and go through the TLC5940.  I looked at the sample library but it pretty much just confused me.  I believe what is suppose to happen is that the Led's are suppose to but turned on and off very quickly so that your eyes cannot detect it and to minimize the amount of power it would take when all of them are on.  Can someone point me at a link or just assist me on how I can control this small matrix with the TLC5940 multiplexed.  I have searched and came across a few things but all of them are a lot more complex.  I prefer to start simple and add up.  Please let me know if you can assist me.  Thank you in advance. 
Title: Re: Tlc5940 multiplexing code
Post by: Starfire on May 20, 2011, 12:57 am
I'm with you on this one, all I seem to find is some old outdated posts and many of them have very basic documentation.
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on May 27, 2011, 07:42 am
I'd love to see this too. I'm embarking on a 49 RGB LED matrix and want to power it with TLC5940's.
Title: Re: Tlc5940 multiplexing code
Post by: Chagrin on May 28, 2011, 05:07 pm
You've seen Grumpy Mike's example? http://www.thebox.myzen.co.uk/Hardware/Mini_Monome.html

In his schematic you'd assumedly be skipping the switch and diode that he has associated with each LED, and also note that all of the R/G/B channels should be connected vertically.
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on May 29, 2011, 10:02 pm

You've seen Grumpy Mike's example? http://www.thebox.myzen.co.uk/Hardware/Mini_Monome.html

In his schematic you'd assumedly be skipping the switch and diode that he has associated with each LED, and also note that all of the R/G/B channels should be connected vertically.


Would http://www.sparkfun.com/products/10349 (http://www.sparkfun.com/products/10349) be a suitable transistor compared to the recommended TPC6108?

Also, would this scale to 7x7 okay? Would I need to change anything other than the resistors?

Thanks!
Title: Re: Tlc5940 multiplexing code
Post by: Grumpy_Mike on May 31, 2011, 11:50 pm
Quote
Also, would this scale to 7x7 okay?

I scaled it to 8X8 in my Hexome http://vimeo.com/20490343 (http://vimeo.com/20490343)
With one TLC5940 per colour so that you can have separate current control allowing you to balance the colours.
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on Jun 01, 2011, 01:27 am

Quote
Also, would this scale to 7x7 okay?

I scaled it to 8X8 in my Hexome
With one TLC5940 per colour so that you can have separate current control allowing you to balance the colours.


Should I still use 15k resistors?
Would this through-hole FET work okay instead of the one you used? http://www.sparkfun.com/products/10349 (http://www.sparkfun.com/products/10349)

Sorry, I'm new to the whole multiplexing thing and electronics in general and want to avoid burning up all those LEDs  :)

Thanks for the help!
Title: Re: Tlc5940 multiplexing code
Post by: Grumpy_Mike on Jun 01, 2011, 10:56 pm
Quote
Should I still use 15k resistors?

Where?


The TLC5940 does not required LEDs to have current limiting resistors as there is a current limiting circuit in the chip. Just one resistor is needed to set the current for all the LEDs.
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on Jun 01, 2011, 11:07 pm

Quote
Should I still use 15k resistors?

Where?

If I'm reading it correctly, your schematic shows 15k resistors connected to each diode. If I'm not using the diodes, I can eliminate the resistors as well then?
Title: Re: Tlc5940 multiplexing code
Post by: Grumpy_Mike on Jun 01, 2011, 11:19 pm
Yes those are pull down resistors for reading the switches. That circuit uses the same matrix scanning that lights the LEDs to scan for key depressions at the same time.
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on Jun 01, 2011, 11:22 pm

Yes those are pull down resistors for reading the switches. That circuit uses the same matrix scanning that lights the LEDs to scan for key depressions at the same time.

Ah I see. And will a 60v 27a FET work okay in lieu of the one you suggest in your schematic?

Thanks for all the help!
Title: Re: Tlc5940 multiplexing code
Post by: Grumpy_Mike on Jun 01, 2011, 11:25 pm
That is one heck of an over specification but as long as it turns on fully with 5V (that is a logic level one) it will work.
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on Jun 05, 2011, 10:09 pm
I've got everything hooked up, but was hoping someone could double-check my work before I blow something up.

In particular I'm worried about a few things:
1) I'm not sure I wired the decoupling capacitors correctly
2) Im not sure I wired the FETs correctly
3) I connected the 5940's together as per the playground article* which seems to differ slightly from Grumpy Mike's schematic †.
4) I used open digital pins to add in the extra rows of LEDs/fets. The pins in Grumpy Mikes schematic seemed pretty particular and some out of order so I'm worried I'm missing something here.
5) The Arduinome_4X4_RGB.pde fails to compile (error: 'PD6' was not declared in this scope)

Note: Ignore the IR LEDs and photoresistors since I don't have those hooked up yet. Also ignore the scribbles on the breadboard. They were there when I bought it from a scrap house and won't come off. :)

EDIT: Also, I know the LED's aren't connected to the 5940's yet, but will connect up by color (RGB) to the three chips.

http://i.imgur.com/1HPjp.jpg (http://i.imgur.com/1HPjp.jpg)
http://i.imgur.com/TQhrT.jpg (http://i.imgur.com/TQhrT.jpg)
http://i.imgur.com/OYwnC.jpg (http://i.imgur.com/OYwnC.jpg)
http://i.imgur.com/qPQnt.jpg (http://i.imgur.com/qPQnt.jpg)


*http://students.washington.edu/acleone/codes/tlc5940arduino/img/breadboard-arduino-tlc5940.png (http://students.washington.edu/acleone/codes/tlc5940arduino/img/breadboard-arduino-tlc5940.png)
†http://www.thebox.myzen.co.uk/Hardware/Mini_Monome_files/4%20X%204%20RGB%20LED%20Matrix.pdf (http://www.thebox.myzen.co.uk/Hardware/Mini_Monome_files/4%20X%204%20RGB%20LED%20Matrix.pdf)

Title: Re: Tlc5940 multiplexing code
Post by: Grumpy_Mike on Jun 07, 2011, 05:36 pm
Quote
The Arduinome_4X4_RGB.pde fails to compile (error: 'PD6' was not declared in this scope)

Looks like there has been a change in the latest Arduino distribution that makes this not compile. Take the TLC5940Multiplex_defines.h file and add the following to the end:-
Code: [Select]
#define PORTB   _SFR_IO8 (0x05)
/* PORTB */
#define PB7     7
#define PB6     6
#define PB5     5
#define PB4     4
#define PB3     3
#define PB2     2
#define PB1     1
#define PB0     0


#define PORTD   _SFR_IO8 (0x0B)
/* PORTD */
#define PD7     7
#define PD6     6
#define PD5     5
#define PD4     4
#define PD3     3
#define PD2     2
#define PD1     1
#define PD0     0

I have now amended this file on my site.

Quote
I connected the 5940's together as per the playground article* which seems to differ slightly from Grumpy Mike's schematic

My schematic uses a modified early version of the TLC5940 library which is what I based my code on. The "official"  library changed some of the pins, there pins have fixed hardware functions so it is not a simple matter to change them. So you must use my wiring with my code or the other wiring with the other code, you can't mix them.
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on Jun 10, 2011, 05:06 am
I'm getting very close! The code complied and some of the LED's are firing, but are very weak. I think it's because there's not enough power. The schematic calls for +5v on pin 19, pin 21 and the FETs. I noticed the schematic says "+5v DC Prog" on pin 19. Does that mean I should be using a separate power supply there?
Title: Re: Tlc5940 multiplexing code
Post by: Grumpy_Mike on Jun 10, 2011, 09:33 am
No, that is the pin you put an extra high voltage on if you want to programme the grey scale correction rom.
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on Jun 12, 2011, 01:13 am

No, that is the pin you put an extra high voltage on if you want to programme the grey scale correction rom.


It turns out I had read 4K7 as "47k". I replaced all the FET resistors with 4.7k and now the brightness is good.

When I power it up or run any of the Processing examples individual rows are different colors, but not individual LED's. To reduce complexity I removed the other two 5940's and reduced the matrix to 4x4, figuring I'll scale it once I get the basics working. Any ideas?

Overall board: http://i.imgur.com/YwVGY.jpg (http://i.imgur.com/YwVGY.jpg)
Closeup of FETs: http://i.imgur.com/cnJ6Q.jpg (http://i.imgur.com/cnJ6Q.jpg)
Closeup of 5940: http://i.imgur.com/H6hmn.jpg (http://i.imgur.com/H6hmn.jpg)
5940/Arduino: http://i.imgur.com/2XZMT.jpg (http://i.imgur.com/2XZMT.jpg)

Video of the issue: http://dl.dropbox.com/u/6253968/rows.mov (http://dl.dropbox.com/u/6253968/rows.mov)
Title: Re: Tlc5940 multiplexing code
Post by: Grumpy_Mike on Jun 12, 2011, 07:03 am
You need to post a schematic not a photo of a jumble of wires.
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on Jun 12, 2011, 07:32 am

You need to post a schematic not a photo of a jumble of wires.


Sorry, I'm trying to follow your schematic exactly, but was only able to get whole rows to light up. I'm really new to reading schematics and think I might have messed something up which is why I posted the pics. I've been tying to get it going all day, but I must be missing something.

Is there anything else I can do to make troubleshooting any easier?
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on Jun 12, 2011, 09:18 am
I've created a Fritzing file which mirrors my breadboard setup at the moment. I've left out the RGB cathode wires for better readability. I hope this helps. I really appreciate all of your help getting me this far!

http://fritzing.org/projects/4x4-arduino-rgb-led-multiplex/
Title: Re: Tlc5940 multiplexing code
Post by: Grumpy_Mike on Jun 12, 2011, 08:46 pm
I haven't got fritzing and due to my limited internet connection at the weekends it will have to be tomorrow before I can look at it.
However in the mean time you can do some tests.
First off do you get the default rows with no other input?
Next change the numbers that initialises the ledBuffer, are these change reflected in what you see on the LEDs?
Now change the wiring so that only one cathode is connected into the TLC5940, that is only have one LED per column on one of the rows. Can you change those numbers in that one row and see the effect?

I looks like you have not wired up something correctly, what type of FET have you used, it should be logic level P-type, and check that you have identified the drain and source correctly.

It could be that all the rows are being powered at the same time if the above is not right.
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on Jun 13, 2011, 12:40 am

First off do you get the default rows with no other input?
Next change the numbers that initialises the ledBuffer, are these change reflected in what you see on the LEDs?

Yes and yes. When I first turn it on I get a row of red, blue, green and a kind of light pink. When I change the values in the sketch and re-upload the changes are reflected on their respective rows.


Now change the wiring so that only one cathode is connected into the TLC5940, that is only have one LED per column on one of the rows. Can you change those numbers in that one row and see the effect?

I'm not sure if I totally follow this one. I removed three of the LEDs from the first column and the color of the remaining LED changes just as the whole row did prior to removing the other LEDs.


I looks like you have not wired up something correctly, what type of FET have you used, it should be logic level P-type, and check that you have identified the drain and source correctly.

I'm using a p-channel FET from sparkfun. Datasheet: http://www.sparkfun.com/datasheets/Components/General/FQP27P06.pdf (http://www.sparkfun.com/datasheets/Components/General/FQP27P06.pdf)
I think I've got it hooked up according to your schematic but it's entirely possible I misunderstood something.

I've hooked up like so:


Here's a screen shot from Fritzing:
(http://i.imgur.com/u16af.png)
Title: Re: Tlc5940 multiplexing code
Post by: Grumpy_Mike on Jun 13, 2011, 06:55 am
Those FETs require 10V to switch on the gates. Don't be fooled by the gate threshold voltage that is just where it starts to cinduct. I am not sure if that would cause your reported problem because it seems they are on all the time rather than not on.
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on Jun 14, 2011, 01:48 am

Those FETs require 10V to switch on the gates. Don't be fooled by the gate threshold voltage that is just where it starts to cinduct. I am not sure if that would cause your reported problem because it seems they are on all the time rather than not on.


I'm glad you mentioned that as the data sheet did confuse me quite a bit. The gate threshold voltage shows a min-max of -2.0 to -4V and the following was in the comments on the product page:

(http://i.imgur.com/E1Z9a.png)

The product description also says:
The FQP27P06 is a very common MOSFET with very low on-resistance and a control voltage (aka gate voltage) that is compatible with most 5V microcontroller or mechanical switches. This allows you to control high-power devices with very low-power control mechanisms.

But again, I'm so ignorant with this stuff. Earlier you indicated that this looks like it would work, but was just over spec. But is it now looking like it won't work at all without 10v and the product page just has some mis-information?
Title: Re: Tlc5940 multiplexing code
Post by: GianfrancoPa on Jun 14, 2011, 01:04 pm
I had a very hard experience with 5940mux library, for this reason I tried to
improve the basic TLC5940 library.

My goal is drive a lot of rgb led using tlc5940 and plex all with UDN2981.

Initially, using the basic tlc5940 library, trying a multiplex, the problems were the interferences between leds.

I solved perfectly the problem using

Code: [Select]
while (tlc_needXLAT);

after the call of

Code: [Select]
Tlc.update();

This permit to wait the completing of PWM cicle, in this way I solved the problem!

This is the engine of my multiplex code:

Code: [Select]
void ligthLedMux() {   
  for (byte j=0; j<digMax; j++) {
    for (byte k=0; k <= nLedMax; k++) {
      if (ListaTransistor[k] == dig[j]) {
        ligthLed(k,ValoriRGB[k][0],ValoriRGB[k][1],ValoriRGB[k][2]);
      }
    }
   
    Tlc.update();
    while (tlc_needXLAT);  //wait for PWM cicle

    for (byte l=0; l<digMax; l++) {      // change multiplex channel
      digitalWrite(dig[l],HIGH);
    }
    digitalWrite(dig[j],LOW);
  }

}

Title: Re: Tlc5940 multiplexing code
Post by: elemeno on Jun 15, 2011, 04:06 am

I had a very hard experience with 5940mux library, for this reason I tried to
improve the basic TLC5940 library.


I greatly appreciate the reply, but if I understand correctly, the library and setup from Grumpy Mike which I'm trying to get working is different from the Tlc5940Mux library and setup from Alex Leone. It seems like I'm really close to getting this working so I'd rather try to figure this out before trying a whole different setup. Besides, his setup seems less documented so I think my chances of getting it working would be smaller.

As for additional troubleshooting:

I tried looking at the serial monitor to see if there was any obvious problems there, but nothing displayed. I did set the speed to 57600.

I've checked the hardware over and over, but can't figure out what/if I screwed up. I still just get solid rows of unique colors, but not individual LEDs. I'm still hunting for FETs more like what Grumpy Mike used, but am still unclear if the FETs I'm using now are definitely a problem.
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on Jun 15, 2011, 05:54 am
I figured it out!!

Of course it was something really dumb on my part. I had wired up the cathodes incorrectly. Now I'm going to try to scale this puppy up and wire in some photoresistors to make it interactive!

Here's what I had before:
(http://i.imgur.com/lzrZg.jpg)

Here's the correct hookup:
(http://i.imgur.com/7aeyJ.jpg)

Bigger versions:
http://i.imgur.com/C43Wy.jpg (http://i.imgur.com/C43Wy.jpg)
http://i.imgur.com/ZYYWm.jpg (http://i.imgur.com/ZYYWm.jpg)
Title: Re: Tlc5940 multiplexing code
Post by: Grumpy_Mike on Jun 15, 2011, 10:39 am
Quote
I figured it out!!


Well done. I bet that mixed feeling of triumph and what an idiot I was, is good.

It is still what I feel when I solve a problem. It's a bit addictive.   :)
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on Jun 18, 2011, 10:09 pm
Quote
I scaled it to 8X8 in my Hexome
With one TLC5940 per colour so that you can have separate current control allowing you to balance the colours.


With your default 4x4 setup I'm left with D5 and D13 pins open. Can I use one of the analog pins to get the 7th row going or do I have to do something else?
Title: Re: Tlc5940 multiplexing code
Post by: Grumpy_Mike on Jun 18, 2011, 11:00 pm
Quote
'm left with D5 and D13 pins open

Not quite follow what you are saying, sorry.
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on Jun 18, 2011, 11:07 pm

Quote
'm left with D5 and D13 pins open

Not quite follow what you are saying, sorry.


Sorry for being unclear. With everything wired up as per the 4x4 schematic all the digital pins are used except D5 and D13, so I figure I can use those to control FETs #5 and #6, but I'm not sure where to hookup FET #7.
Title: Re: Tlc5940 multiplexing code
Post by: Grumpy_Mike on Jun 18, 2011, 11:15 pm
Oh I see, yes you can use these to control other FETs and also use the analogue pins to control others.
A better way would be to use a 74LS42 as in this project http://www.thebox.myzen.co.uk/Hardware/Econo_Monome.html (http://www.thebox.myzen.co.uk/Hardware/Econo_Monome.html) to drive more FETs with fewer lines.
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on Jun 18, 2011, 11:41 pm

Oh I see, yes you can use these to control other FETs and also use the analogue pins to control others.
A better way would be to use a 74LS42 as in this project http://www.thebox.myzen.co.uk/Hardware/Econo_Monome.html (http://www.thebox.myzen.co.uk/Hardware/Econo_Monome.html) to drive more FETs with fewer lines.


An in doing so, I figure i'd need to change the line in TLC5940Multiplex.cpp:

Code: [Select]
static int8_t rowPin[4] = {8, 2, 11, 7};   // pins to enable or turn on each row, low = on
to
Code: [Select]
static int8_t rowPin[7] = {8, 2, 11, 7, 5, 13, 16};   // pins to enable or turn on each row, low = on

Did I do that right and is there anything else I'd need to update?
Title: Re: Tlc5940 multiplexing code
Post by: Grumpy_Mike on Jun 18, 2011, 11:44 pm
That looks OK, did you also set the pin mode to output for the extra pins?
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on Jun 19, 2011, 12:00 am

That looks OK, did you also set the pin mode to output for the extra pins?


I'm trying to but am a little confused.

If I put pinMode(A0, OUTPUT); into TLC5940Multiplex.cpp I get an error like
Code: [Select]
'A0' was not declared in this scope

I also tried it in void setup within Arduinome_4x4_RGB.pde but I still have the same row and columns not lighting up.

Lastly, I noticed this in TLC5940Multiplex.cpp
Code: [Select]
// iniilise multiplex row selects and turn them all off (off = 1 as we have a P channel FET)
    for (i = 0; i<4; i++){

I tried changing the 4 to 7, but then just one column lit up.
Title: Re: Tlc5940 multiplexing code
Post by: Grumpy_Mike on Jun 19, 2011, 09:06 am
You already have:-
Quote
static int8_t rowPin[7] = {8, 2, 11, 7, 5, 13, 16};   // pins to enable or turn on each row, low = on

Which is using the A2 pin (that's the 16) so all you have to do is to use:-
pinMode(16, OUTPUT);
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on Jun 19, 2011, 09:46 am

You already have:-
Quote
static int8_t rowPin[7] = {8, 2, 11, 7, 5, 13, 16};   // pins to enable or turn on each row, low = on

Which is using the A2 pin (that's the 16) so all you have to do is to use:-
pinMode(16, OUTPUT);


I did this in void setup() in Arduinome_4x4_RGB.pde but I'm not getting output for pin A2 or D13. From looking at the code it seems it's only setup for 4x4 RGB (48 LEDs), but my setup is now 7x7 (147 LEDs). I took several passes trying to scale the code for 7x7 but had no luck.

Do you have the code you used for your 8x8 project available online?
Title: Re: Tlc5940 multiplexing code
Post by: Grumpy_Mike on Jun 19, 2011, 05:35 pm
Yes it is the library code you have to hack as well. Unfortunately the 8X8 monome is a different arrangement and so the code won't help you. I have never done more than a 4:1 multiplex on the TLC9540.
What you have to do is to increase the count before you wrap round. At the moment this is done with an increment and an AND with 3 instruction. That will only work for multiplex lines that are powers of two. You need to do something like:-
index++;
if(index >= 7) index=0;
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on Jun 19, 2011, 09:25 pm

Yes it is the library code you have to hack as well. Unfortunately the 8X8 monome is a different arrangement and so the code won't help you. I have never done more than a 4:1 multiplex on the TLC9540.
What you have to do is to increase the count before you wrap round. At the moment this is done with an increment and an AND with 3 instruction. That will only work for multiplex lines that are powers of two. You need to do something like:-
index++;
if(index >= 7) index=0;


Okay, I'm going to try to take it slow and do as much research on my own as to not drive you crazy while I figure this out.  :)

A couple of questions to help get me going though..

1) Are there any resources/documentation on multiplexing in general or this driver that I can reference?

2) I'm trying to wrap my head around the LED buffer code. If I read the comment correctly, each LED is 12 bits (0-4095) and each hex number is 1 byte (8 bits). Does this mean that each led 'shares' a byte with its neighbor? Also, what does 'bb', 'bg', 'gg' etc refer to? I figure this is some simple math thing

Code: [Select]
* Each value is 12 bits (0-4095).  24 bytes is 192 bits, which is 16 led's * 12 bits each.  Each of the numbers in the array below is 1 byte (0-255).
*    For example,
*
*  | 1st byte | 2nd byte | 3rd byte | 4th byte | 5th byte | 6th byte | ...
*  | LED 16 value   | LED 15 value  | LED 14 value   | LED 13 value  | ...
*/

// Change this array initilisation to get a diffrent switch on pattern

static uint8_t ledBuffer[] = {
// row 1 (botom)
  //     lower LEDs not used        bb    bg    gg    rr    rb    bb    gg    gr    rr    bb    bg    gg     rr    rb    bb      gg    gr    rr
// row 2
   0x0, 0x0, 0x0, 0x0, 0x0, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,  0x40, 0x00, 0x00,   0x00, 0x04, 0x00, // red row



Also, this doesn't work yet, but do you mean something like this?
Code: [Select]
    scanindex++;
    if (scanindex >=7) {
        scanindex=0;
    }
   
    scan = (scanindex) & 3; // Increment row count
    bRow = pBuffer[scan];   // point at next row in the bufer precalculated to save time
Title: Re: Tlc5940 multiplexing code
Post by: Grumpy_Mike on Jun 20, 2011, 12:03 am
Quote
Also, what does 'bb', 'bg', 'gg' etc refer to?


that is the distribution of bits in the array and so is the answer to your second question
so in the blue (b) is defined by the first two nibbles (4 bits is a nibble two nibbles in a byte) of the first byte and the most significant nibble of the second byte. That second byte has it's least significant nibble as the most significant nibble of the green brightness with the two lease significant nibbles in the third byte.
so in binary you have
bbbb bbbb  - bbbb gggg       - gggg gggg
First byte --- second byte  ---- third byte
This puts together two 12 bit numbers in three bytes.

Code: [Select]
scan = (scanindex) & 3; // Increment row count
This is the bit you have to remove as that constrains scan to a number between 0 and 3
Title: Re: Tlc5940 multiplexing code
Post by: elemeno on Jun 20, 2011, 06:39 am
Some good news and a question.

After tinkering all day I finally 'got it' and was able to scale and layout a new ledBuffer. The trouble was that I was only getting the last 4 rows to light up. After some trial and error I found if I comment out the code to get the state of the push-buttons, the rest of the rows turn on as expected. I don't  have buttons on my project. Do you know why that bit of code would interfere?

Here's the code I commented out:
Code: [Select]
// read the state of the push buttons
    for(uint8_t i = 0 ; i<multiplexColoums; i++){
        buttonPressed[i][scan] = digitalRead(switchInput[i]);
    }


Full code:
Modified driver: http://pastebin.com/HQa1mWvb (http://pastebin.com/HQa1mWvb)
Modified sketch: http://pastebin.com/zXKJjJ8P (http://pastebin.com/zXKJjJ8P)
Title: Re: Tlc5940 multiplexing code
Post by: Grumpy_Mike on Jun 20, 2011, 09:45 am
Well done for getting it, my Wife looked at my last post and said "that is just rubbish!"

It looks like you hadn't expanded the keyboard buffer to take the extra non existent keys and that was over writing your LED buffer.