Go Down

Topic: PWM over Shift Register Library (For RGB LED's) (Read 28812 times) previous topic - next topic


http://www.arduino.cc/en/Tutorial/ShiftOut is the basic schematic.  The only difference here is the code to drive it.

The 74595 can sink or drive current so you can use it with Common Anode or Cathode LEDs - you might have to reverse the on or off logic as on will be off and vice versa.

As for TLC5940s - there is an issue with the library at the moment that results in flicker, bleed over etc..  Someone posted working alternate code but I cannot find it on the forum right now.  I do need to test it myself as I had stalled my project that relied on them due to this issue.


Nov 21, 2010, 01:46 am Last Edit: Nov 21, 2010, 02:32 pm by frustro Reason: 1
Yay!  Looking at the images on your website, I was able to reconstruct the design.  I have a little "flitter" after it loops through the function, I put a 103 cap on the latch pins, not sure what's happening there.

For those asking for a schematic,   in his code, the PWM pins are

#define __dataPin 9
#define __clockPin 10
#define __latchPin 11

A 75HC595 wires up pretty easily,  you can reference the ShiftOut tutorial here http://www.arduino.cc/en/Tutorial/ShiftOut

As for the daisy chain of the 595's....

PIN 11       SH_CP       Shift register (clock pin)
PIN 12       ST_CP       Storage register clock pin (latch pin)

are linked from one to the next, so from 11 to 11 and from 12 to 12.

The serial data is output on PIN 9       Q7" Serial Out

and PIN 14 DS       Serial data input.

So from the first 595 to the second go from pin 9 to 14 and so forth.

Here is a vid with 4 RGB's.  
I will expand to 16 and update here in a bit.

16. going 32 next


Knob allows me to control the length and rate.
Button to change between the two.
switch to change direction.


Great project! It is possible to run LED cube (monocolor or RGB) on this code? In cube we need multiplex layers and address rows.

Go Up