#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#define HARDWARE_TYPE MD_MAX72XX::PAROLA_HW
#define MAX_DEVICES 4
#define DATA_PIN 11
#define CLK_PIN 13
#define CS_PIN 10
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
char message[50] = "Hello, Munna, How are YOU";
void setup() {
Serial.begin(115200);
P.begin();
P.setIntensity(5); // Brightness (0-15)
P.displayClear();
P.displayText(
message,
PA_CENTER,
50,
1000,
PA_SCROLL_LEFT,
PA_SCROLL_LEFT
);
Serial.println("Type a message and press Enter...");
}
void loop() {
if (P.displayAnimate()) {
P.displayReset();
}
if (Serial.available()) {
String txt = Serial.readStringUntil('\n');
txt.trim();
if (txt.length() > 0) {
txt.toCharArray(message, sizeof(message));
P.displayClear();
P.displayText(
message,
PA_CENTER,
50,
1000,
PA_SCROLL_LEFT,
PA_SCROLL_LEFT
);
P.displayReset();
}
}
}