#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4 // Number of 8x8 modules in the chain
#define DATA_PIN 23 // DIN pin
#define CS_PIN 22 // CS pin
#define CLK_PIN 21 // CLK pin
// Create the matrix object
MD_Parola matrix = MD_Parola(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
// Clear any previous display
void displayNumbers() {
matrix.displayClear();
// Set text and animation parameters to scroll numbers from right to left
matrix.displayText("1 2 3 4 5 6 7 8 9 10 . . .", PA_LEFT, 100, 0, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
// Loop to keep animating the scrolling text
while (!matrix.displayAnimate()) {
// Continuously animate text until done
}
matrix.displayReset();
}
void setup() {
matrix.begin(); // Initialize the matrix
matrix.setIntensity(5); // Set brightness (0-15)
displayNumbers(); // Display scrolling numbers before the main text
// Set text and animation parameters for name and NRP
matrix.displayText("SILA ULFANIA - 5024221016", PA_LEFT, 100, 0, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
}
void loop() {
if (matrix.displayAnimate()) { // Update the animation
matrix.displayReset(); // Reset to loop the animation
}
}