#include <SPI.h>
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
// Define the pins for the first MAX7219 module
#define CS1 15 // Chip select pin
#define DIN1 23 // Data in pin
#define CLK1 18 // Clock pin
// Define the pins for the second MAX7219 module
#define CS2 5 // Chip select pin
#define DIN2 19 // Data in pin
#define CLK2 14 // Clock pin
// Define the texts to display on the modules
const char* text1 = "Hello World!";
const char* text2 = "ESP32 Rocks!";
// Create instances of the MD_Parola library for each module
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
MD_Parola mx1 = MD_Parola(HARDWARE_TYPE, CS1, CLK1, DIN1, 1); // Adjust HARDWARE_TYPE based on your LED matrix
MD_Parola mx2 = MD_Parola(HARDWARE_TYPE, CS2, CLK2, DIN2, 1); // Adjust HARDWARE_TYPE based on your LED matrix
#define SCROLL_SPEED 50 // Adjust scrolling speed as needed
void setup() {
mx1.begin(); // Initialize the first MAX7219 module
mx2.begin(); // Initialize the second MAX7219 module
mx1.setIntensity(1); // Set the brightness for the first module (adjust as needed)
mx2.setIntensity(1); // Set the brightness for the second module (adjust as needed)
}
void loop() {
mx1.displayText(text1, PA_LEFT, SCROLL_SPEED, 0, PA_PRINT); // Display text on the first module
mx2.displayText(text2, PA_LEFT, SCROLL_SPEED, 0, PA_PRINT); // Display text on the second module
delay(2000); // Adjust delay between activities as needed
}