Trying to use 8x8 Matrix

Hello Friends,
I need to say, I have never used an Arduino before (so I am beginner), but I have read through many tutorials.
I am using an ESP8266 12-e, together with four 8x8-Matrix put together. (I think it is called MAX7219, bought that one here: https://www.amazon.de/gp/css/order-history?ie=UTF8&ref_=nav_youraccount_orders&)

I configured the device itself and I am now into the programming part.

So, having 32x8 led dots put together (such that it is landscape mode, 32 being horizontal), I would like to either

  1. put four characters onto the board (such that every character is on it’s own 8x8)
    or
  2. just put all four together such that it can shift together from right to left (or vice versa)

I am working on finding a way that either of them works. I found several examples in the Internet, but none of them really explains what I want to.

At first: I am using this library, because it was used in many tutorials:

It’s old and I needed to change some few things, but it still works.

There are two files which I used.
The first one is this here:

/*
      8x8 LED Matrix MAX7219 Example 01

   by Dejan Nedelkovski, www.HowToMechatronics.com

   Based on the following library:
   GitHub | riyas-org/max7219  https://github.com/riyas-org/max7219
*/

#include "MaxMatrix.h"

int DIN = 5;   // DIN pin of MAX7219 module
int CS = 4;    // CS pin of MAX7219 module
int CLK = 0;   // CLK pin of MAX7219 module
int maxInUse = 4;


MaxMatrix m(DIN, CS, CLK, maxInUse); 

const byte IMAGES[][10] = {
{8,8,
  B00000000,
  B00011000,
  B00011000,
  B00111000,
  B00011000,
  B00011000,
  B00011000,
  B01111110
},{8,8,
  B00000000,
  B00111100,
  B01100110,
  B00000110,
  B00001100,
  B00110000,
  B01100000,
  B01111110
},{8,8,
  B00000000,
  B00111100,
  B01100110,
  B00000110,
  B00011100,
  B00000110,
  B01100110,
  B00111100
},{8,8,
  B00000000,
  B00001100,
  B00011100,
  B00101100,
  B01001100,
  B01111110,
  B00001100,
  B00001100
},{8,8,
  B00000000,
  B01111110,
  B01100000,
  B01111100,
  B00000110,
  B00000110,
  B01100110,
  B00111100
},{8,8,
  B00000000,
  B00111100,
  B01100110,
  B01100000,
  B01111100,
  B01100110,
  B01100110,
  B00111100
},{8,8,
  B00000000,
  B01111110,
  B01100110,
  B00001100,
  B00001100,
  B00011000,
  B00011000,
  B00011000
},{8,8,
  B00000000,
  B00111100,
  B01100110,
  B01100110,
  B00111100,
  B01100110,
  B01100110,
  B00111100
},{8,8,
  B00000000,
  B00111100,
  B01100110,
  B01100110,
  B00111110,
  B00000110,
  B01100110,
  B00111100
},{8,8,
  B00000000,
  B00111100,
  B01100110,
  B01101110,
  B01110110,
  B01100110,
  B01100110,
  B00111100
}};
byte A[] = {4, 8,
            B01111110,
            B00010001,
            B00010001,
            B01111110,
           };

char B[] = {4, 8,
            B01111111,
            B01001001,
            B01001001,
            B00110110,
           };

char smile01[] = {8, 8,
                  B00111100,
                  B01000010,
                  B10010101,
                  B10100001,
                  B10100001,
                  B10010101,
                  B01000010,
                  B00111100
                 };
char smile02[] = {8, 8,
                  B00111100,
                  B01000010,
                  B10010101,
                  B10010001,
                  B10010001,
                  B10010101,
                  B01000010,
                  B00111100
                 };
char smile03[] = {8, 8,
                  B00111100,
                  B01000010,
                  B10100101,
                  B10010001,
                  B10010001,
                  B10100101,
                  B01000010,
                  B00111100
                 };
byte test[] = {8, 8,
                  B11111111,
                  B11111111,
                  B11111111,
                  B11111111,
                  B11111111,
                  B11111111,
                  B11111111,
                  B11111111
                 };

void setup() {
  m.init(); // MAX7219 initialization
  m.setIntensity(2); // initial led matrix intensity, 0-15
}

void loop() {
  // Seting the LEDs On or Off at x,y or row,column position
  //m.setDot(6,2,true); 
  //delay(1000);
  //m.setDot(6,3,true);
  //delay(1000);
  //m.clear(); // Clears the display
  //for (int i=0; i<8; i++){
    //m.setDot(i,i,true);
    //delay(300);
  //}
  //m.clear();

  //const byte* sprite
  m.writeSprite(0,0,IMAGES[1]);
  //m.writeSprite(0,0,test);
  //delay(1000);
  // Displaying the character at x,y (upper left corner of the character)  
 // m.writeSprite(2, 0, A);
 // delay(1000);

  //m.writeSprite(2, 0, B);
 // delay(1000);

  //m.writeSprite(0, 0, smile01);
  //delay(1000);
  
  //m.writeSprite(0, 0, smile02);
  //delay(1000);
  
  //m.writeSprite(0, 0, smile03);
  //delay(1000);
  
  for(int i=0;i<8;i++) {
    m.shiftLeft(false,false);
    delay(500);
  }

  /*for(int i=0;i<8;i++) {
    m.shiftDown(false);
    delay(500);
  }*/
  /*for (int i=0; i<8; i++){
    m.shiftLeft(false,false);
    delay(300);
  }
  m.clear();*/

}

Here the weird thing is, what happens when I change the “maxInUse” value. If I put 1 in there, then everything I am programming happens on all four at the same time, like four mirrors. If I put “4” into it, everything only happens on the left one.
And I do not find out how I can manage to send commands to the other three.

Does anyone has any idea how to do this? The api doesn’t really have a command for this:

void init();
    void clear();
    void setCommand(byte command, byte value);
    void setIntensity(byte intensity);
    void setColumn(byte col, byte value);
    void setColumnAll(byte col, byte value);
    void setDot(byte col, byte row, byte value);
    void writeSprite(int x, int y, const byte* sprite);
    
    void shiftLeft(bool rotate = false, bool fill_zero = true);
    void shiftRight(bool rotate = false, bool fill_zero = true);
    void shiftUp(bool rotate = false);
    void shiftDown(bool rotate = false);

Sorry, I exceeded the maximum size, here is part two:
The second example is a little bit more weird, and I still didn’t got fully what happens her inside the code:

/*

//******************************************************************************
// visit this web page for further information about MaxMatrix library
// https://code.google.com/p/arudino-maxmatrix-library/
//******************************************************************************


#include "MaxMatrix.h"
#include <avr/pgmspace.h>

byte CH[] = {
3, 8, B00000000, B00000000, B00000000, B00000000, B00000000, // space
1, 8, B01011111, B00000000, B00000000, B00000000, B00000000, // !
3, 8, B00000011, B00000000, B00000011, B00000000, B00000000, // "
5, 8, B00010100, B00111110, B00010100, B00111110, B00010100, // #
4, 8, B00100100, B01101010, B00101011, B00010010, B00000000, // $
5, 8, B01100011, B00010011, B00001000, B01100100, B01100011, // %
5, 8, B00110110, B01001001, B01010110, B00100000, B01010000, // &
1, 8, B00000011, B00000000, B00000000, B00000000, B00000000, // '
3, 8, B00011100, B00100010, B01000001, B00000000, B00000000, // (
3, 8, B01000001, B00100010, B00011100, B00000000, B00000000, // )
5, 8, B00101000, B00011000, B00001110, B00011000, B00101000, // *
5, 8, B00001000, B00001000, B00111110, B00001000, B00001000, // +
2, 8, B10110000, B01110000, B00000000, B00000000, B00000000, // ,
4, 8, B00001000, B00001000, B00001000, B00001000, B00000000, // -
2, 8, B01100000, B01100000, B00000000, B00000000, B00000000 // .
// there would be some more characters here, but I exceed the 9000 characters again, sorry for this

};

int data = 5;    // DIN pin of MAX7219 module
int load = 4;    // CS pin of MAX7219 module
int clock2 = 0;  // CLK pin of MAX7219 module

int maxInUse = 4;    //change this variable to set how many MAX7219's you'll use

MaxMatrix m(data, load, clock2, maxInUse); // define module

byte buffer[10];


char string1[] = " A B C D E F G H I J K L M N O P Q R S T U V X W Y Z ";
char string2[] = " a b c d e f g h i j k l m n o p q r s t u v x w y z ";
char string3[] = " 1 2 3 4 5 6 7 8 9 0 - = ";
char string4[] = " ! @ # $ % ¨ & * ( ) _ + ";
char string5[] = " ' , . ; ~ ] ´ [ | < > : ^ } ` { / ?  ";
char heipaadeg[] = "Hello World";




void setup(){
  m.init(); // module initialize
  m.setIntensity(0); // dot matix intensity 0-15
  Serial.begin(9600); // serial communication initialize
}

void loop(){
  /*
  // this is the code if you want to entering a message via serial console
  while (Serial.available() > 0){
    byte c = Serial.read();
    Serial.println(c, DEC);
    printCharWithShift(c, 100);
  }
  delay(100);
  m.shiftLeft(false, true);
  */
  
  // print the active sentences
 //printStringWithShift(string1, 100);
 printString(heipaadeg);
 //printStringWithShift(string2, 100);
 //printStringWithShift(string3, 100);
 //printStringWithShift(string4, 100);
 //printStringWithShift(string5, 100);

}

void printCharWithShift(char c, int shift_speed){
  if (c < 32) return;
  c -= 32;
  memcpy_P(buffer, CH + 7*c, 7);
  m.writeSprite(32, 0, buffer);
  m.setColumn(32 + buffer[0], 0);
  
  for (int i=0; i<buffer[0]+1; i++) 
  {
    delay(shift_speed);
    m.shiftLeft(false, false);
  }
}

void printStringWithShift(char* s, int shift_speed){
  while (*s != 0){
    printCharWithShift(*s, shift_speed);
    s++;
  }
}

void printString(char* s)
{
  int col = 0;
  while (*s != 0)
  {
    if (*s < 32) continue;
    char c = *s - 32;
    memcpy_P(buffer, CH + 7*c, 7);
    m.writeSprite(col, 0, buffer);
    m.setColumn(col + buffer[0], 0);
    col += buffer[0] + 1;
    s++;
  }
}

Here, all four are in use on their own if I put four into the value.
But what happens? Every of the four is it’s own running led-strip, vertical.
Meaning, the text starts on the most right 8x8-panel, 90° tipped to the left and runs through. After some milliseconds, the third one starts the same as well, then the second, then the first. Looks funny, but isn’t what I am looking for.

Is there anyone of you who is working with this library and can tell me how I can alter one of my to examples such that I can get one of my two wanted scenarios?
I just wonder how I can address the four different panels in the first example.

Many greetings and thanks for any answer

This is why the boards all display in different directions

Unless the library support the different possible orientations of the matrix, you will be doing software gymnastics to make your display work. Your brain will hurt :-).