I am controlling a large bi colour matrix with
this board, or one similar, containing two 7219's.
This sketch
#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
We have only a single MAX72XX.
*/
LedControl lc=LedControl(7,8,9,2);// pins 10=DataIn, 9=CLK, 8=LOAD + 2 MAX7221s
/* we always wait a bit between updates of the display */
unsigned long delaytime=1000;
void setup() {
/*
The MAX72XX is in power-saving mode on startup,
we have to do a wakeup call
*/
lc.shutdown(0,false);
/* Set the brightness to a medium values */
lc.setIntensity(0,4);
lc.setIntensity(1,10);
// lc.setIntensity(2,10);
/* and clear the display */
lc.clearDisplay(0);
}
/*
This method will display the characters for the
word "Arduino" one after the other on the matrix.
(you need at least 5x7 leds to see the whole chars)
*/
void writeArduinoOnMatrix() {
/* here is the data for the characters */
byte g1[]={B00011000,
B00111000,
B00011000,
B00011000,
B00011000,
B00011000,
B00011000,
B00111100,};
byte g2[]={B00111000,
B01111100,
B01101100,
B00001100,
B00011000,
B00110000,
B01111100,
B01111100};
byte g2b[]={B00011000,
B00100100,
B00000100,
B00000100,
B00001000,
B00010000,
B00100000,
B00111100};
/* now display them one by one with a small delay */
lc.shutdown(0,true);
delay(10);
lc.shutdown(1,false);
delay(10);
lc.setRow(1,0,g1[0]);
lc.setRow(1,1,g1[1]);
lc.setRow(1,2,g1[2]);
lc.setRow(1,3,g1[3]);
lc.setRow(1,4,g1[4]);
lc.setRow(1,5,g1[5]);
lc.setRow(1,6,g1[6]);
lc.setRow(1,7,g1[7]);
delay(delaytime);
lc.shutdown(1,true);
delay(10);
lc.shutdown(0,false);
delay(10);
lc.setRow(0,0,g2[0]);
lc.setRow(0,1,g2[1]);
lc.setRow(0,2,g2[2]);
lc.setRow(0,3,g2[3]);
lc.setRow(0,4,g2[4]);
lc.setRow(0,5,g2[5]);
lc.setRow(0,6,g2[6]);
lc.setRow(0,7,g2[7]);
delay(delaytime);
lc.shutdown(0,true);
delay(10);
lc.shutdown(1,false);
delay(10);
lc.setRow(1,0,g2b[0]);
lc.setRow(1,1,g2b[1]);
lc.setRow(1,2,g2b[2]);
lc.setRow(1,3,g2b[3]);
lc.setRow(1,4,g2b[4]);
lc.setRow(1,5,g2b[5]);
lc.setRow(1,6,g2b[6]);
lc.setRow(1,7,g2b[7]);
delay(delaytime);
}
void loop() {
writeArduinoOnMatrix();
}
runs red and green but I can't find anywhere that mentions putting both leds on at the same time and getting orange?
The library cpp file gives reference to addr but I can see nowhere that addr is addressed?
I have tried changing LedControl lc=LedControl(7,8,9,2) to (7,8,9,3), adding lc.shutdown(0,true);
lc.shutdown(2,false); and each of the ic,setRow's to (addr=2) but the screen just goes blank.
I have read somewhere that you have to make one shutdown true before you can make another one false so I don't want to make 0 and 1 false but I can't see any other way of getting orange?