hello
so i've started using arduino and shift registers. with the lack of knowledge and the bit of c programing that i know (not that much) , and also through a lot of research , i was able to control an 8x8 dot matrix with 2 74hc595 chips which were not daisy chained (all though a was not able to control it like i wanted du to the lack of knowledge).
now i made a bigger matrix, a 8x32 and already wired up all the shift register. 4 of them are daisy chained to get 32 outputs for the 32 colums and 1 is used for the 8 rows.
here is the problem now .
to try if the matrix was functioning properly i just upoaded the code of a smily face of the 8x8 matrix to the 8x32 matrix and 4 smily faces show up .
now i wanted t do something else with the matrix , i know how to send 8 bits but not 32
.
i'm having troube adapting the code to the 8x32 matrix . all my for loops are from 0 to 8 and i thought that changing the inner loop to 32 wold work buuuut it didn't
they way my matrix is wired only allows one row to be lit a time .
and i know the max7219 exists and its a lot easier ( i actualy bought one 8x32 controled with the max7219) people say that should use that one instead, but i just want to know how it works with these 74hc595
//Columns
int clockpin1 = 2;
int latchpin1 = 3;
int datapin1 = 4;
//Rows
int clockpin2 = 5;
int latchpin2 = 6;
int datapin2 = 7;
void setup() {
pinMode(latchpin1, OUTPUT);
pinMode(clockpin1, OUTPUT);
pinMode(datapin1, OUTPUT);
pinMode(latchpin2, OUTPUT);
pinMode(clockpin2, OUTPUT);
pinMode(datapin2, OUTPUT);
}
int pic[] = {0, 0, 102, 102, 0, 0, 66, 60};
void loop()
{
for (int i=0 ; i<8 ; i++)
{
digitalWrite(latchpin2, LOW);
shiftOut(datapin2, clockpin2,MSBFIRST,128>>i);
digitalWrite(latchpin1, LOW);
for (int j=0 ; j<8 ; j++)
{
shiftOut(datapin1, clockpin1,MSBFIRST,pic[i]);
}
digitalWrite(latchpin1, HIGH);
digitalWrite(latchpin2, HIGH);
}
}