Hi! I have a few pieces of small 5x7 led matrix and I would like to use them somehow. I am running a basic sketch for text scrolling:
int data[] = {
0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, 0b11111111, // full
0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, // blank
0b00000000, 0b00011110, 0b00110011, 0b00110111, 0b00111011, 0b00110011, 0b00110011, 0b00011110, // 0
0b00000000, 0b00001100, 0b00011100, 0b00001100, 0b00001100, 0b00001100, 0b00001100, 0b00111111, // 1
0b00000000, 0b00011110, 0b00110011, 0b00000011, 0b00000110, 0b00011000, 0b00110000, 0b00111111, // 2
0b00000000, 0b00011110, 0b00110011, 0b00000011, 0b00001110, 0b00000011, 0b00110011, 0b00011110, // 3
0b00000000, 0b00000110, 0b00001110, 0b00010110, 0b00100110, 0b00111111, 0b00000110, 0b00000110, // 4
0b00000000, 0b00111111, 0b00110000, 0b00111110, 0b00000011, 0b00000011, 0b00110011, 0b00011110, // 5
0b00000000, 0b00011110, 0b00110011, 0b00110000, 0b00111110, 0b00110011, 0b00110011, 0b00011110, // 6
0b00000000, 0b00111111, 0b00110011, 0b00000110, 0b00000110, 0b00001100, 0b00001100, 0b00001100, // 7
0b00000000, 0b00011110, 0b00110011, 0b00110011, 0b00011110, 0b00110011, 0b00110011, 0b00011110, // 8
0b00000000, 0b00011110, 0b00110011, 0b00110011, 0b00011111, 0b00000011, 0b00110011, 0b00011110, // 9
0b00000000, 0b00011110, 0b00110011, 0b00110011, 0b00111111, 0b00110011, 0b00110011, 0b00110011, // A
0b00000000, 0b00111110, 0b00110011, 0b00110011, 0b00111110, 0b00110011, 0b00110011, 0b00111110, // B
0b00000000, 0b00011110, 0b00110011, 0b00110000, 0b00110000, 0b00110000, 0b00110011, 0b00011110, // C
0b00000000, 0b00111110, 0b00110011, 0b00110011, 0b00110011, 0b00110011, 0b00110011, 0b00111110, // D
0b00000000, 0b00111111, 0b00110000, 0b00110000, 0b00111110, 0b00110000, 0b00110000, 0b00111111, // E
0b00000000, 0b00111111, 0b00110000, 0b00110000, 0b00111110, 0b00110000, 0b00110000, 0b00110000, // F
0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, 0b00000000, // blank
};
void setup ()
{
//set pins to output
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}
void loop()
{
for (int n = 0; n < 144; n++)
{
for (int t = 0; t < 10; t ++) //Show repeated 10 times
{
int dat = 0x01;
for (int num = n; num < 8 + n; num++)
{
shiftOut(dataPin, clockPin, LSBFIRST, data[num]); //control ROW of dot matrix
shiftOut(dataPin, clockPin, LSBFIRST, ~dat); //control COL of dot matrix
//return the latch pin high to signal chip that it
//no longer needs to listen for information
digitalWrite(latchPin, HIGH); //pull the latchPin to save the data
//delay(1); //wait for a microsecond
digitalWrite(latchPin, LOW); //ground latchPin and hold low for as long as you aretransmitting
dat = dat << 1;
delay(2); //wait for a microsecond
}
}
}
}
The fact is that this sketch was written for an 8x8 led matrix, and the 5x7 is different, and I would need to reverse the orientation. At this point, the orientation is vertical, like this:
0
1
2
...
And I would like to make it horizontal, like this:
0 1 2 ...
because the 5x7 matrix is rectangular, therefore narrower, and I want to change the direction on the wider side.


There is little work to be done. The circuit is for an 8x8 matrix that has anodes on the row and cathodes on the column. The 5x7 matrix is opposite, it has anodes on the column and cathodes on the row. I followed the anodes and cathodes from the circuit, so my circuit for the 5x7 matrix is like this:
U2 (Anodes)
Q0 _
Q1 _
Q2 col6
Q3 col5
Q4 col4
Q5 col3
Q6 col2
Q7 col1
U3 (Cathodes)
Q0 row1
Q1 row2
Q2 row3
Q3 row4
Q4 row5
Q5 row6
Q6 row7
Q7 _