Scrolling text (4 x MAX7219)
MD_MAX72XX scrolls a message across a 32x8 matrix, over hardware SPI.

The code
// Four MAX7219 matrices in a chain (an FC-16 module), on the Uno's SPI port
// (DIN 11, CLK 13) with CS on 10. MD_MAX72XX's font, scrolled a column at a time.
#include <MD_MAX72xx.h>
#include <SPI.h>
MD_MAX72XX mx(MD_MAX72XX::FC16_HW, 10, 4);
const char message[] = " HELLO FROM ARGYNIX LAB ";
uint8_t glyph[8];
uint8_t glyphWidth = 0, glyphColumn = 0;
const char *next = message;
void setup() {
mx.begin();
mx.control(MD_MAX72XX::INTENSITY, 4);
mx.clear();
}
void loop() {
if (glyphColumn >= glyphWidth) {
if (*next == 0) next = message;
glyphWidth = mx.getChar(*next++, sizeof(glyph), glyph) + 1;
glyph[glyphWidth - 1] = 0; // a blank column between letters
glyphColumn = 0;
}
mx.transform(MD_MAX72XX::TSL);
mx.setColumn(0, glyph[glyphColumn++]);
delay(40);
}


