// Including the required Arduino libraries
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
// Uncomment according to your hardware type
//#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define HARDWARE_TYPE MD_MAX72XX::PAROLA_HW
// Defining size, and output pins
#define MAX_DEVICES 1
#define CS_PIN 53
// Create a new instance of the MD_Parola class with hardware SPI connection
MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
String reader;
char displayer[10] = "";
void setup() {
Serial.begin(9600);
Serial.println();
// Intialize the object
myDisplay.begin();
// Set the intensity (brightness) of the display (0-15)
myDisplay.setIntensity(0);
}
void loop() {
if(Serial.available()){
while(Serial.available()){
reader = Serial.readString();
}
reader.trim();
for(int j = 0; j < reader.length()+1; j++){
displayer[j] = reader[j];
}
Serial.println(displayer);
myDisplay.displayClear();
myDisplay.displayScroll(displayer, PA_CENTER, PA_SCROLL_LEFT, 100);
}
if (myDisplay.displayAnimate()) {
myDisplay.displayReset();
}
}