How to code a scrolling led matrix

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

Your message 'smile' is already 8x8. You need a space before the 'smile' and perhaps a space after it.

Yes I know but I want for it to srollo onto the screen and off it and how do I do that and what do you mean by space.

Check out the Parola library, does what you are after.

I can't figure what your smile looks like from the bits you have in smile[]. I may be able to offer more help.

Try:

byte smile[] = {
 B00000000,
 B00000000,
 B00000000,
 B00000000,
 B00000000,
 B00000000,
 B00000000,
 B00000000,

  B00000101,
  B00000111,
  B00000101,
  B00000000,
  B00110111,
  B01010001,
  B01010111,
  B00110001
  };]

Then send 16 columns instead of 8.

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.

Paul

The Parola library (see the link in my signature) will do exactly what you are asking for + more.

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.

The Max7219 chips, one for each digit is way overkill. Yes, it can be done with just about any shift register or port expander IC. http://www.taydaelectronics.com/ic-integrated-circuits/display-drivers/max7219-7-segment-dot-point-common-cathode-serially-interfaced-display-driver-pdip-24.html http://www.taydaelectronics.com/ic-integrated-circuits/74-series/74hc-series/74hc595-8-bit-shift-register-ic.html As you can see, 10 74hc595's for the price of 1 Max7219. Good price on 8x8 displays: http://www.taydaelectronics.com/led-displays/dot-matrix.html

Lets see your schematic. HC595 means you have to write your own multiplexing code, which you seem to have a good start on:

digitalWrite(LATCH, LOW); shiftOut(DATA, CLOCK, MSBFIRST, ~smile[a]>>shift); // columns shiftOut(DATA, CLOCK, LSBFIRST, binary[a]); // rows digitalWrite(LATCH, HIGH);

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.

steinie44, to be clear: it’s one mAX7219 for each 8x8 matrix, not each digit.

Yes, if using small fonts, but not on large fonts, 8x8.

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.