Saturday, October 10, 2015

Daisy Chained MAX7219 Led Drivers

This project builds off of some work I did earlier with the MAX7219 led driver running a single 8X8 led matrix. Now I'm getting two of them daisy chained and driving 2 matrices. I'm moving the project off the breadboard and onto a perfboard, as well. This post has great instructions for wiring one driver and led matrix, which I've gone back to again and again.
One MAX7219 soldered and connected, running a random worm program. The second driver out in front isn't connected yet.

A second wired to the first.
Wiring diagram for daisy chain
Wiring diagram comes from this forum.


Programming Daisy Chained Drivers

In the program, to add a second driver, the following statements have to be modified:
  1. When you create the object, the last argument is the number of drivers, so change to 2. LedControl lc = LedControl(12, 11, 10, 2);
  2. Repeat all setup statements for the second driver, the first argument of each is which driver in an array.
      lc.shutdown(0, false); 
      lc.shutdown(1, false); 
      lc.setIntensity(0, 4);  
      lc.setIntensity(1, 4); 
  3. Finally, when addressing which leds to turn on/off, the first argument is which LED matrix in an array they belong to. To turn on the upper left LED on the first matrix is lc.setLed(0, 0, 0, true); and for the same position on the second is lc.setLed(1, 0,0, true);
More to come! I still have to solder the second one on.
Woo-hoo! All done!

Under the board:

No comments :