#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#define HARDWARE_TYPE MD_MAX72XX::PAROLA_HW
#define MAX_DEVICES 12
#define CLK_PIN 13
#define DATA_PIN 11
#define CS_PIN 10
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
void setup() {
Serial.begin(115200);
P.begin();
P.setIntensity(2);
Serial.println("Hello");
}
bool runScroll = true;
bool printStop = false;
void loop() {
static uint8_t i = 0; // text effect index
if (Serial.available()) {
char inChar = Serial.read();
if (inChar == 'S') printStop = true;
}
if (runScroll) {
if (P.displayAnimate()) // animates and returns true when an animation is completed
{
P.displayText("Some Scrolling Text, Send \"S\" to Stop me", PA_LEFT, 50, 0, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
P.displayReset();
}
}
if (printStop) {
runScroll = !runScroll;
P.displayClear();
P.displayText("ALL STOP", PA_CENTER, 0, 0, PA_PRINT, PA_NO_EFFECT);
P.displayAnimate();
printStop = !printStop;
}
}