I've been playing around with my arduino for a few days now and I'd like to start my first real project...
I would like to individually control 36 RGB LEDs (with PWM), so from what I've been reading on the boards I need to "extend" my arduino board with more pins (3 pins per RGB LED so that would make a total of 108 additional pins??) with TLC5940 chips...
So I found this hxxp://blushingboy.org/content/dusk , it has 64 pins that support PWM so I thought I would buy 2 of those and chain them up together?
I had a look at the TLC5940 library for arduino & I have a question concerning it's usage for a LED, how can I define a certain color for a led as it uses grayscale value instead of RGB/HEX values ?
Tlc.set(uint8_t channel (0-(NUM_TLCS * 16 - 1)), int value (0-4095))
So let's say I would like to have a purple glowing LED, how would I know the value I have to use for each R, G, B pin ?
Thanks for your help!
And please give me any advices you might have concerning my setup
Each LED in the RGB LED is a separate LED. Controlled by a separate channel of the TLC5940. So set the grey scale (brightness) value of each LED to get the colours you want.
What I don't understand is what the bightness value corresponds to
It is a 12 bit value so a value of 4095 represents the full current through the LED as set by the external current resistor. So half that value, 2047, represents half that current. Actually it is full current but only on for half the time, because it is a PWM control.
How am I gonna know how much brightness of each channel is needed to get a specific color
You don't, you have to experiment, because the same current through each colour in the RGB LED does not produce the same brightness. You roughly know the proportions of RGB you need from your colour so a good start is setting the channels at that. Then you adjust them until you get the tint right.