Home

Awesome

LED-Matrix

Single/bi/tri-color LED Matrix PWM driver for arduino (direct IO or Shift Register connected)

Blog post with video: http://marc.merlins.org/perso/arduino/post_2015-01-06_Driver-for-direct-driving-single-to-3-color-LED-Matrices-with-software-PWM.html

This code implements equivalent and additional functionality from what you get from Adafruit's https://github.com/adafruit/Adafruit-LED-Backpack-Library

Adafruit sells bi color 8x8 LED matrices with an I2C interface. They are easy to program with the adafruit library, but doing per pixel PWM is virtually impossible, which means you only get 3 colors: Red, Green, and Orange (red+green). See: http://www.adafruit.com/product/902

I wrote this driver to control raw LED matrices which is a lot more work, but provides more flexibility. My code allows you to connect the matrices directly to any arduino IO pins or via shift registers for the columns (adding shift register support for rows is easy, but I haven't done it yet since it makes the code slower and I didn't need to save extra IO pins)

Here is how my approach differs from Adafruit's: Summary: if you don't need to mix color intensities (3 colors is enough vs 256), buy adafruit's solutions, they are much simpler for you and leave CPU time and IO pins on the arduino. But if you already have raw LED matrices with no driver chip, this code is for you. Note that if you buy a MAX7219 driver chip, you'll have the same problem than the adafruit solution and will not be able to mix colors intensities. I've found that this newer chip http://www.maximintegrated.com/en/products/power/display-power-control/MAX6961.html can do bi color and 4 step PWM (not as good as my code, but not bad). You may still want to look at a MAX6960.

Pluses for my solution:

Minuses for my solution:

Required libraries: