Pages: 1 [2]   Go Down
Author Topic: How to connect Arduino Uno to 25 rgb leds?  (Read 2290 times)
0 Members and 1 Guest are viewing this topic.
Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 603
Posts: 33385
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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

@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....

Logged

Arduino...addicted

Ticino (Switzerland)
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, thanks again! I ordered the shift registers and the Common anode rgb leds, so in a few days i will begin my project! smiley-wink
@ 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!!!
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 603
Posts: 33385
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: 1 [2]   Go Up
Jump to: