Hi
I would like to code my led matrix so it has scrolling text that starts of the screen then scrolls onto the screen and of the led matrix. I managed to get the pic to start on the screen and scroll of it.The code for that is below
is
// Project 24 - Animating an LED Matrix
#define DATA 6 // connect to pin 14 on the 74HC595
#define LATCH 8 // connect to pin 12 on the 74HC595
#define CLOCK 10 // connect to pin 11 on the 74HC595
byte smile[] = {
B00000101,
B00000111,
B00000101,
B00000000,
B00110111,
B01010001,
B01010111,
B00110001
};
int binary[] = {
1, 2, 4, 8, 16, 32, 64, 128};
void setup()
{
pinMode(LATCH, OUTPUT);
pinMode(CLOCK, OUTPUT);
pinMode(DATA, OUTPUT);
}
void loop()
{
int a, hold, shift;
for ( shift = 0 ; shift < 9 ; shift++ )
{
for ( hold = 0 ; hold < 25 ; hold++ )
{
for ( a = 0 ; a < 8 ; a++ )
{
digitalWrite(LATCH, LOW);
shiftOut(DATA, CLOCK, MSBFIRST, ~smile[a]>>shift); // columns
shiftOut(DATA, CLOCK, LSBFIRST, binary[a]); // rows
digitalWrite(LATCH, HIGH);
delay(1);
}
}
}
}
So how would i need to modify the code to make it start off screen and scroll onto the screen and off it.
Also if i can do the above how can i scroll mesages that are bigger than 8 pixels by 8 pixels ( my matrix is 8x8) without daisy chaining more matrixes.
Thanks Daniel
Hi Daniel. Why the urgency this time? Dad's birthday coming up next? Ask your dad to tell you the story of the boy who cried wolf. And please stop writing sentances in capitals, it is considered similar to shouting.
How would I adapt my code so it uses parola and can it be used with the 74hc595 shift register as the parola circuit diagrams on the link use Max7219 chips.
So what you need now is to incorporate blink without delay style code.
You will have two timing schedules running.
One will do the multiplexing above, every 1mS you will drive a new column of data.
The second will update what is now the smile[] array.
One way to do that is to have a large array with your entire "message" in it.
Then you can copy 8 columns of that into the smile[] array for the multiplexer code to display. Every 50-100mS or so you update the data.
So 0-7 to start, then 1-8, 2-9, 3-10 and so on.
steinie44, to be clear: it's one mAX7219 for each 8x8 matrix, not each digit.
Benefit is it offloads the multiplexing code from the processor, the code then only updates the data to be displayed every 50-100mS, leaving more processing available for other stuff.
If the font is scrolling, I don't see that it matters what size the font is.
Larger size, say 4 or 5 columns wide, will show 1 letter and part of the next all the time.