Multiple led matrices, some shows wrong symbol

Hello,
I'm new to Arduino and currently working with an Arduino Nano powered by an external power supply. I'm experimenting with LED matrices — I've connected 10 of them in series and I'm trying to display numbers from 0 to 9.

The first 8 numbers display correctly, but for some reason, the last two matrices don't show 8 and 9. Instead, they repeat 0 and 1. I've also tried displaying different symbols, but the result is always the same — the last two matrices show the first two symbols again.

I would really appreciate any advice or suggestions.
Thanks!


My code:

#include "LedControl.h"

#define DIN 10
#define CS  11
#define CLK 12
#define matrix 10
#define bright 5

LedControl ledMat=LedControl(DIN, CLK, CS, matrix);

byte num0[8] = {
  B00000000,
  B00011000,
  B00100100,
  B01000010,
  B01000010,
  B00100100,
  B00011000,
  B00000000
};

byte num1[8] = {
  B00000000,
  B00010000,
  B00110000,
  B00010000,
  B00010000,
  B00010000,
  B00111000,
  B00000000
};

byte num2[8] = {
  B00000000,
  B00111000,
  B01000100,
  B00000100,
  B00011000,
  B00100000,
  B01111100,
  B00000000
};

byte num3[8] = {
  B00000000,
  B00111000,
  B01000100,
  B00001000,
  B00000100,
  B01000100,
  B00111000,
  B00000000
};

byte num4[8] = {
  B00000000,
  B00001000,
  B00011000,
  B00101000,
  B01001000,
  B01111100,
  B00001000,
  B00000000
};

byte num5[8] = {
  B00000000,
  B01111100,
  B01000000,
  B01111000,
  B00000100,
  B01000100,
  B00111000,
  B00000000
};

byte num6[8] = {
  B00000000,
  B00111000,
  B01000000,
  B01111000,
  B01000100,
  B01000100,
  B00111000,
  B00000000
};

byte num7[8] = {
  B00000000,
  B01111100,
  B00000100,
  B00001000,
  B00010000,
  B00010000,
  B00010000,
  B00000000
};

byte num8[8] = {
  B00000000,
  B00111000,
  B01000100,
  B00111000,
  B01000100,
  B01000100,
  B00111000,
  B00000000
};

byte num9[8] = {
  B00000000,
  B00111000,
  B01000100,
  B01000100,
  B00111100,
  B00000100,
  B00111000,
  B00000000
};




void setup() {
  for(int j=0; j<matrix; j++) {
    ledMat.shutdown(j,false);
    ledMat.setIntensity(j,bright);
    ledMat.clearDisplay(j);
  }
}

void loop() {
  for(int i=0; i<8; i++) {
    ledMat.setRow(0, i, num0[i]);
    ledMat.setRow(1, i, num1[i]);
    ledMat.setRow(2, i, num2[i]);
    ledMat.setRow(3, i, num3[i]);
    ledMat.setRow(4, i, num4[i]);
    ledMat.setRow(5, i, num5[i]);
    ledMat.setRow(6, i, num6[i]);
    ledMat.setRow(7, i, num7[i]);
    ledMat.setRow(8, i, num8[i]);
    ledMat.setRow(9, i, num9[i]);
  }
}

It doesn't work because this library supports a maximum of 8 cascaded matrices.

Use library “MD_Parola.h”. Suport several displays.

GitHub - MajicDesigns/MD_Parola: Library for modular scrolling LED matrix text displays

See this demo:

https://wokwi.com/projects/437201339458207745

To be fair to @dominik_b, a beginner should not have to read the library code to find out about such limitations. It should be documented somewhere, but I can't find any mention of this limit in any of the library's documentation.

I agree. Unfortunately, it is very rare for a library to have complete and comprehensive documentation. When I use a library, I often look at the source code simply to familiarize myself with its features. This is how I have discovered undocumented functions as well as in what range the functions themselves work. Very often, the comments in the source code provide more and more useful information than the documentation, if there is any at all.