// Define the number of devices (LED matrices)
#define NUM_DEVICES 4
#include "LedControl.h"
#define DIN_PIN 12
#define CLK_PIN 11
#define CS_PIN 10
// Create an instance of the LedControl class
LedControl lc = LedControl(DIN_PIN, CLK_PIN, CS_PIN, NUM_DEVICES);
void setup() {
// Initialize the LED matrix
lc.shutdown(0, false); // Wake up display
lc.setIntensity(0, 16); // Set brightness level (0 is min, 15 is max)
lc.clearDisplay(0); // Clear display register
}
void loop() {
// Define the pattern for the column
byte Pattern1 = B11111111;
byte Pattern2 = B00000000; // Example pattern, LED on at the beginning and end
// Set the column pattern on the LED matrix
// Parameters: device number, column number, pattern
//lc.setColumn(0, 0, columnPattern);
//lc.setColumn(0, 7, columnPattern);
lc.setRow(0, 0, Pattern1); //for LED panel 1
lc.setColumn(0, 0, Pattern1);
lc.setRow(1, 0, Pattern1); //for LED panel 2
lc.setColumn(1, 7, Pattern1);
lc.setRow(2, 7, Pattern1); //for LED panel 3
lc.setColumn(2, 0, Pattern1);
lc.setRow(3, 7, Pattern1); //for LED panel 4
lc.setColumn(3, 7, Pattern1);
delay(1000); // Delay for visibility
}