Go Down

Topic: How to connect Arduino Uno to 25 rgb leds? (Read 2974 times) previous topic - next topic

Grumpy_Mike

Quote
but in the code how can i control the single led?

Simply by setting or clearing a single bit in the data.
Each bit controls one LED.
On the arduino this is easy with the bit set and clear instructions.

@CrossRoads:

yes. I want to multiplex and take advantage of the 3 TLC5940's at my disposal, would prefer to use it with its 16 outputs rather than the 74HC595.

But now… distracted by the ShiftPWM library.

Hmmm....

Arduino...addicted

NicolaBu

Hello, thanks again! I ordered the shift registers and the Common anode rgb leds, so in a few days i will begin my project! ;)
@ grumpy_mike, i saw the arduino clear bit but i can't understand hit it works, can you please make an example? Is it right my scheme i uploaded?

Thank you for the help!!!

Grumpy_Mike

When you send stuff to a shift register with shiftOut you send a variable containing a number. This is held in the computer as a binary number. To turn all the LEDs off you might set this number to zero.
To turn only the last LED in the shift register on the number you send hasto have a logic one in the lastbinary bit position in the word. So to do this you can use the set bit for bit seven instruction on the variable that was previously zero.
Look up the syntax of this instruction in the referance section.

Go Up