matrice 7*24 cant display all my message

Hello everybody, For my project which I have to finish in 2 days i have a grid of led (7*8 *3) connected to MAX7219 and to arduino.
i followed this tuto (Matrix & Sprite Arduino Libraries, for a many-LED display!) to connect all components and to get a basic code.
i succed todisplay a scrolling message (with my own libraby of letter) but when my message is too heavy (problem beguins approximatly at 22 letters) i reach 2 problem:

  • the 23th and 10 following ones (for example) lettre are displayed in the same time (merged) as the 10 first
  • The scrolling is very much slower than when there is only 3 letters to display .
    i quote part of my code to explain

#include <Sprite.h> // Sprite before Matrix
#include <Matrix.h>
int nbletter=18;
int nbword=5;
long a=25; // (where will beguin the letter display)
long y=0;// (y coordinate)
int nbmax7219=3;
int delaydisplay=25;
// DIN, CLK, LOAD, #chips
Matrix myLeds = Matrix(11, 13, 10, 3);
Sprite A = Sprite(5,7, //code of all lettre
Sprite B = Sprite(5,7,

void setup() {
void loop() {
word y;
word a;// instead of “byte”
for (y=0; y< (6nbletter+8nbmax7219+1); y++) { // loop which scroll my display
myLeds.write(a-y, 0, A);
myLeds.write(a-1-y, 0, space);
myLeds.write(a-y, 0, B);
myLeds.write(a-1-y, 0, space);


i think i have a variable which cant ecced 255 but i tried to only long instead of int or char but nothing happen
have you any idea about that ?

An other question which can resolve all problem :
i tried this code
it works so perfectly but coordinate X and Y are switched . i have 2 option :
reweld my threes matrix (take a long time )
switch y and x in the code but i dont find how to do it
have you any idea ?