fezder
Well-Known Member
Yup, I now made bigger matrix from 8x8's. circuit is 5 daisy chained 74595's, again shift registers. First one handles anodes (rows) and rest columns (cathodes), so matrises are row anode-column cathode. I've succeeded to display simple test code showing 5x8 font scrolling, but thing is they are displayed at all 4 matrises same time (just like intended in code)
What I actually am trying to accomplish is to use whole area effectively as large screen for say scrolling text. Have code also that allows to create stationary characters without scrolling but there is flicker seen (probably because I made it by displaying one matrix at a time)
Any hints ,links, tips? Should Imake 2d-array where to store data, or what would be best approach? Preferably without libraries because this far has been well without them.
I read that some examples mention bit mask, but I'll gladly hear suggestions and such while trying to get this work....
current code as follows: (sorry, some of font is HEX and some in binary, haven't cleaned it yet....)
What I actually am trying to accomplish is to use whole area effectively as large screen for say scrolling text. Have code also that allows to create stationary characters without scrolling but there is flicker seen (probably because I made it by displaying one matrix at a time)
Any hints ,links, tips? Should Imake 2d-array where to store data, or what would be best approach? Preferably without libraries because this far has been well without them.
I read that some examples mention bit mask, but I'll gladly hear suggestions and such while trying to get this work....
current code as follows: (sorry, some of font is HEX and some in binary, haven't cleaned it yet....)
C:
int dataPin = 2; //IC 14 //Define which pins will be used for the Shift Register control
int latchPin = 3; //IC 12
int clockPin = 4; //IC 11
//OE-GND
//MR-VCC
int delaytime = 1, timer, timerPrev = 0;
int shift = 0;
int len = 400;
static uint8_t x [400] =
{
0xff, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0xff, // square
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // block
0x00, 0x7c, 0xa2, 0x92, 0x8a, 0x7c, 0x00, 0x00, // 0
0x00, 0x42, 0xfe, 0x02, 0x00, 0x00, 0x00, 0x00, // 1
0x00, 0x42, 0x86, 0x8a, 0x92, 0x62, 0x00, 0x00, // 2
0x00, 0x84, 0x82, 0xa2, 0xd2, 0x8c, 0x00, 0x00, // 3
0x00, 0x18, 0x28, 0x48, 0xfe, 0x08, 0x00, 0x00, // 4
0x00, 0xe4, 0xa2, 0xa2, 0xa2, 0x9c, 0x00, 0x00, // 5
0x00, 0x3c, 0x52, 0x92, 0x92, 0x0c, 0x00, 0x00, // 6
0x00, 0x80, 0x8e, 0x90, 0xa0, 0xc0, 0x00, 0x00, // 7
0x00, 0x6c, 0x92, 0x92, 0x92, 0x6c, 0x00, 0x00, // 8
0x00, 0x60, 0x92, 0x92, 0x94, 0x78, 0x00, 0x00, // 9
0x00, 0x7e, 0x90, 0x90, 0x90, 0x7e, 0x00, 0x00, //A
0x00, 0x7e, 0x92, 0x92, 0x6c, 0x00, 0x00, 0x00, //B
B00000000, B01111100, B10000010, B10000010, B10000010, B01000100, B00000000, B00000000, //C
B00000000, B11111110, B10000010, B10000010, B10000010, B01111100, B00000000, B00000000, //D
B00000000, B11111110, B10010010, B10010010, B10010010, B10000010, B00000000, B00000000, //E
B00000000, B11111110, B10010000, B10010000, B10010000, B10000000, B00000000, B00000000, //F
B00000000, B01111100, B10000010, B10001010, B10001010, B01001100, B00000000, B00000000, //G
B00000000, B11111110, B00010000, B00010000, B00010000, B11111110, B00000000, B00000000, //H
B00000000, B00000000, B10000010, B11111110, B10000010, B00000000, B00000000, B00000000, //I
B00000000, B00001100, B00000010, B00000010, B00000010, B11111100, B00000000, B00000000, //J
B00000000, B11111110, B00010000, B00101000, B01000100, B10000010, B00000000, B00000000, //K
B00000000, B11111110, B00000010, B00000010, B00000010, B00000010, B00000000, B00000000, //L
B00000000, B11111110, B01000000, B00100000, B01000000, B11111110, B00000000, B00000000, //M
B00000000, B11111110, B00100000, B00010000, B00001000, B11111110, B00000000, B00000000, //N
B00000000, B01111100, B10000010, B10000010, B10000010, B01111100, B00000000, B00000000, //O
B00000000, B11111110, B10010000, B10010000, B10010000, B01100000, B00000000, B00000000, //P
B00000000, B01111100, B10000010, B10001010, B10000110, B01111110, B00000000, B00000000, //Q
B00000000, B01111110, B10010000, B10011000, B10010100, B01100010, B00000000, B00000000, //R
B00000000, B01100100, B10010010, B10010010, B10010010, B01001100, B00000000, B00000000, //S
B00000000, B10000000, B10000000, B11111110, B10000000, B10000000, B00000000, B00000000, //T
B00000000, B11111100, B00000010, B00000010, B00000010, B11111100, B00000000, B00000000, //U
B00000000, B11111000, B00000100, B00000010, B00000100, B11111000, B00000000, B00000000, //V
B00000000, B11111110, B00000100, B00001000, B00000100, B11111110, B00000000, B00000000, //W
B00000000, B11000110, B00101000, B00010000, B00101000, B11000110, B00000000, B00000000, //X
B00000000, B11000000, B00100000, B00011110, B00100000, B11000000, B00000000, B00000000, //Y
B00000000, B10000110, B10001010, B10010010, B10100010, B11000010, B00000000, B00000000, //Z
B00000000, B01000000, B10000000, B10001010, B10010000, B01100000, B00000000, B00000000, //?
B00000000, B00000000, B00000000, B11111010, B00000000, B00000000, B00000000, B00000000, //!
B00000000, B00010000, B00010000, B01111100, B00010000, B00010000, B00000000, B00000000, //+
B00000000, B00010000, B00010000, B00010000, B00010000, B00010000, B00000000, B00000000, //-
B00000000, B00101000, B00101000, B00101000, B00101000, B00101000, B00000000, B00000000, //=
B00000000, B00000000, B00000000, B01111100, B10000010, B00000000, B00000000, B00000000, //(
B00000000, B00000000, B10000010, B01111100, B00000000, B00000000, B00000000, B00000000, //)
};
void setup()
{
DDRD = DDRD | B00011100; //set pins as output
}
void loop()
{
timer = millis ();
if (timer - timerPrev > 100)
{
shift++;
if (shift == len)shift = 0;
timerPrev = timer;
}
for (int i = 0; i < 8; i++)
{
PORTD = B00000000; //turn latch low
shiftOut(dataPin, clockPin, MSBFIRST, 1 << i); //Send the data #2 (what columns to power) all columns work at same time here
shiftOut(dataPin, clockPin, MSBFIRST, 1 << i); //Send the data #2 (what columns to power)
shiftOut(dataPin, clockPin, MSBFIRST, 1 << i); //Send the data #2 (what columns to power)
shiftOut(dataPin, clockPin, MSBFIRST, 1 << i); //Send the data #2 (what columns to power)
shiftOut(dataPin, clockPin, LSBFIRST, x[i + shift > len - 1 ? i + shift - len : i + shift]); //Send the data #1 ( what data to draw)
PORTD = B00001000; //turn latch on->show screen
//delayMicroseconds (1000); //seems not needed
}
}
Last edited: