#include <Adafruit_GFX.h>
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
// Define the number of rows and columns for the matrix
#define MAX_DEVICES 1 // Set the number of 8x8 matrices you're using
Max72xxPanel matrix = Max72xxPanel(11, 13, 10, MAX_DEVICES); // Pin numbers for DIN, CLK, LOAD
void setup() {
matrix.setIntensity(5); // Set brightness (0-15)
matrix.setRotation(0); // Set rotation (0-3)
matrix.fillScreen(LOW); // Turn off all LEDs initially
}
void loop() {
// Example: Draw a simple pattern (a cross)
matrix.clear(); // Clear the previous pattern
matrix.drawLine(0, 0, 7, 7, HIGH); // Diagonal line from top-left to bottom-right
matrix.drawLine(7, 0, 0, 7, HIGH); // Diagonal line from top-right to bottom-left
delay(1000); // Wait for 1 second
matrix.clear(); // Clear the screen
// Example: Create a checkerboard pattern
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
if ((i + j) % 2 == 0) {
matrix.drawPixel(i, j, HIGH); // Draw a pixel (on)
}
}
}
delay(1000); // Wait for 1 second
matrix.clear(); // Clear the screen
}