hi,
I finally get my dual color matrix and max 7219, however I found no. of problem, anyone can help?
1) the matrix keeps on turn on for all the LED instead, may I know how to make sure my 7291IC is working? ( i have tried to unplug the 3 digital pins, all the LED still light up)
2) I can see through the schematic of the LED matrix which defines as rows and columns, however there is no clear indication on how to top 12 pins and bottom 12 pins link to each row and columns.
Here is the note I got, want to make sure if this is correct:
photo:
http://www.flickr.com/photos/siusoon/3244754471/ 3) my code as below, but still all the light are on instead:
///////////
int CLOCK = 12;
int LATCH = 8;
int DATA = 13;
/*int dataIn = 8;
int load = 13;
int clock = 12;
*/
byte matrix[8];
byte head;
int state = 0;
void setup() {
pinMode(CLOCK, OUTPUT);
pinMode(LATCH, OUTPUT);
pinMode(DATA, OUTPUT);
digitalWrite(CLOCK, LOW);
digitalWrite(LATCH, LOW);
digitalWrite(DATA, LOW);
initLED();
clearLED();
Serial.begin(9600);
head = (byte) 0x55;
}
void loop() {
if (Serial.available()>0) {
int input = Serial.read();
switch (state) {
case 0:
if (input==head) {
state = 1;
}
break;
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
matrix[state-1] = (byte) input;
state++;
break;
case 8:
matrix[state-1] = (byte) input;
state = 0;
refreshLED();
break;
}
}
}
void ledOut(int n) {
digitalWrite(LATCH, LOW);
shiftOut(DATA, CLOCK, MSBFIRST, (n>>

);
shiftOut(DATA, CLOCK, MSBFIRST, (n));
digitalWrite(LATCH, HIGH);
delay(1);
digitalWrite(LATCH, LOW);
}
void initLED() {
ledOut(0x0B07);
ledOut(0x0A0C);
ledOut(0x0900);
ledOut(0x0C01);
}
void clearLED() {
for (int i=0;i<8;i++) {
matrix
= 0x00;
}
refreshLED();
}
void refreshLED() {
int n1, n2, n3;
for (int i=0;i<8;i++) {
n1 = i+1;
n2 = matrix;
n3 = (n1<<
+n2;
ledOut(n3);
}
}
void updateLED(int i, int j, boolean b) {
int t = 1;
int n = 0;
int m = 0;
if (j==0) {
m = 7;
}
else {
m = j-1;
}
n = t<<m;
if (b) {
matrix = n | matrix;
}
else {
n = ~n;
matrix = n & matrix;
}
}
////////////////////////