Arduino library · Displays

MD_Parola: scrolling text and effects on MAX7219 matrices

Yes. You can use the MD_Parola library online in Mokxi with nothing to install, and the sketch runs in your browser against the simulated part (LED matrix, 8x8). The example below, "Scrolling text with MD_Parola", runs on the Arduino Uno R3.

Built in on Mokxi: #include <MD_Parola.h> and it builds, with nothing to install. Free, and no account needed.

What MD_Parola does

MD_Parola turns a row of MAX7219 8x8 LED modules into a text display with animation built in. You give it a string, an alignment, a speed, a pause and an entry and exit effect, and it scrolls, wipes, dissolves or opens the text for you. It sits on top of MD_MAX72xx, which does the pixel work, so both headers are included.

Everything runs from displayAnimate(). It never blocks: each call moves the animation one step if its time has come and returns true once the text has gone through its full in, pause and out cycle. That is the moment to call displayReset() to play it again, or displayText() with a new message. A sketch that calls delay() for long stretches will make the animation stutter.

Two settings decide whether you see text or a scramble. HARDWARE_TYPE must match how the modules are built (most blue four-in-one boards are FC16_HW), and MAX_DEVICES must be the number of 8x8 modules in the chain. Bigger setups split the chain into zones, each with its own text and effect. In Mokxi the effects are drawn from the library’s own descriptions, so their frames are close to the real ones rather than identical.

Library Manager nameMD_Parola
AuthorMajicDesigns
Include#include <MD_Parola.h>
Boardsevery board Mokxi compiles for but ATtiny85
In the simulatorSimulated: it runs against the part the way it does on the bench.
Parts it drivesLED matrix, 8x8

Install it

It builds on every board Mokxi compiles for but ATtiny85.

In Mokxi it is built in: #include <MD_Parola.h> and the sketch compiles, with no download, no zip and no Library Manager.

On a real board, install "MD_Parola" by MajicDesigns from the Arduino IDE’s Library Manager (Sketch, Include Library, Manage Libraries), or add MD_Parola to lib_deps in PlatformIO. Mokxi follows the calls of release 3.7.7, so a sketch written here builds there too.

What to know in the simulator: The effects are drawn from upstream’s descriptions of them, so their frames are close to upstream’s rather than the same.

The calls you will use

In the order a sketch meets them.

MD_Parola myDisplay = MD_Parola(MD_MAX72XX::FC16_HW, CS_PIN, MAX_DEVICES)

Makes the display on the hardware SPI pins (DIN on 11 and CLK on 13 on an Uno) with chip select on CS_PIN and the number of 8x8 modules in the chain.

myDisplay.begin()

Starts the modules with one zone covering all of them. begin(2) makes two zones, which setZone() then assigns modules to.

myDisplay.setIntensity(2)

Brightness from 0 to 15. Low values save a lot of current on long chains.

myDisplay.displayText("Hello", PA_CENTER, 40, 500, PA_SCROLL_LEFT, PA_SCROLL_LEFT)

Sets up an animation: the text, its alignment, the frame time in ms (lower is faster), the pause in ms once it is in place, and the entry and exit effects.

myDisplay.displayAnimate()

Advances the animation if it is due. Returns true when the cycle has finished. Call it on every pass of loop().

void loop() {
  if (myDisplay.displayAnimate()) {
    myDisplay.displayReset();
  }
}

myDisplay.displayReset()

Restarts the current animation from the beginning, for text that should loop forever.

myDisplay.print("12:45")

Shows text at once with no animation, handy for a clock that updates every second.

myDisplay.setZone(0, 0, 3)

Assigns modules 0 to 3 to zone 0. Module 0 is the one at the input end of the chain, usually the rightmost.

Example: Scrolling text with MD_Parola

On the Arduino Uno R3. It runs in the browser exactly as printed.

sketch.ino · Arduino Uno R3
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>

#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4
#define CS_PIN 10

MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

void setup() {
  Serial.begin(9600);
  myDisplay.begin();
  myDisplay.setIntensity(2);
  myDisplay.displayClear();
  myDisplay.displayText("Hello Mokxi", PA_CENTER, 40, 500, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
}

void loop() {
  if (myDisplay.displayAnimate()) {
    Serial.println("once round");
    myDisplay.displayReset();
  }
}

Wiring

  • Arduino Uno R3 11 to LED matrix, 8x8 DIN
  • Arduino Uno R3 13 to LED matrix, 8x8 CLK
  • Arduino Uno R3 10 to LED matrix, 8x8 CS
  • Arduino Uno R3 5V to LED matrix, 8x8 VCC
  • Arduino Uno R3 GND to LED matrix, 8x8 GND

Open it in the editor, wired and ready to run

Common errors and how to fix them

Letters are mirrored, upside down or scrambled into vertical bars

HARDWARE_TYPE does not match the modules. Try MD_MAX72XX::FC16_HW first, then PAROLA_HW, GENERIC_HW and ICSTATION_HW until the text reads normally.

The text never scrolls, or only moves now and then

displayAnimate() is not being called often enough, usually because of a delay() or a slow sensor read in loop(). Keep loop() short and let displayAnimate() run on every pass.

The message shows once and then the display goes blank

After the exit effect, the animation stays finished until it is reset. Check the return value of displayAnimate() and call displayReset() or displayText() when it is true.

Questions and answers

How is MD_Parola different from MD_MAX72xx?

MD_MAX72xx sets pixels and columns; MD_Parola adds text layout, fonts, zones and the animated effects on top of it. Use MD_MAX72xx alone for games and graphics.

Which effects are there?

Print, the scrolls in four directions and the diagonals, slice, mesh, fade, dissolve, blinds, random, wipe, scans, opening and closing, grow and sprites, each chosen with a PA_ name.

Projects that use MD_Parola

Built-in projects that include it. Each page has the full sketch and opens in the editor, already wired.

Try MD_Parola without installing anything

Open the example, change the sketch, and keep your version in a free account.