Ok, new problem. Step 2 of my project is to control the bi-colors of my LED matrix. My schematic is attached.
I have proven that each MAX7219 is wired correctly by using the code from before to drive one and simply remove the other from the circuit by taking it out entirely. I see all LEDs light up perfect. The problem is when I have both MAX7219's in at once none of my LEDs display.
Here is my code:
#include "LedControl.h"
/*
Now we need a LedControl to work with.
***** These pin numbers will probably not work with your hardware *****
pin 12 is connected to the DataIn
pin 11 is connected to the CLK
pin 10 is connected to LOAD
*/
LedControl lc=LedControl(12,11,10,2);
/*
This time we have more than one device.
But all of them have to be initialized
individually.
*/
void setup() {
lc.shutdown(0,true);
lc.shutdown(1,true);
lc.setIntensity(0,8);
lc.clearDisplay(0);
lc.setIntensity(1,8);
lc.clearDisplay(1);
}
void loop() {
lc.shutdown(1,true);
lc.shutdown(0,false);
for (int row=0; row<8; row++)
{
for (int col=0; col<8; col++)
{
lc.setLed(0,col,row,true); // turns on LED at col, row
delay(10);
lc.setLed(0,col,row,false); // turns off LED at col, row
delay(10);
}
}
lc.shutdown(0,true);
lc.shutdown(1,false);
for (int col2=0; col2<8; col2++)
{
for (int row2=0; row2<8; row2++)
{
lc.setLed(1,col2,row2,true); // turns on LED at col, row
delay(10);
lc.setLed(1,col2,row2,false); // turns off LED at col, row
delay(10);
}
}
}
