Chaining 4 MAx7219 8x8 Matrices, but all showing different Symbols

Currently, I have an issue, that I have looked into a lot.

I have 4 8x8 Led Max7219 Matrices daisy chained with Female to Female Wired, (All wired correctly I have checked with an Example from Parola)

I want each 8x8 Matrix to display a different symbol statically from the next.

Currently I want each matrix to display one LED each. - Is this something better to do with the MD-Max7219XX library?

#include <LedControl.h>

// Matrix Control Pins
#define CLK 13
#define DIN 11
#define CS 10

// LedControl instances - Only 3 now
LedControl lc1 = LedControl(DIN, CLK, CS, 0);
LedControl lc2 = LedControl(DIN, CLK, CS, 1);
LedControl lc3 = LedControl(DIN, CLK, CS, 2);
LedControl lc4 = LedControl(DIN, CLK, CS, 3);

void setup() {
  // Initialize matrices (adjusting intensity as needed)
  lc1.shutdown(0, false); lc1.setIntensity(0, 3); lc1.clearDisplay(0);
  lc2.shutdown(0, false); lc2.setIntensity(0, 3); lc2.clearDisplay(0);
  lc3.shutdown(0, false); lc3.setIntensity(0, 3); lc3.clearDisplay(0);
  lc4.shutdown(0, false); lc4.setIntensity(0, 3); lc4.clearDisplay(0);

}

void loop() {
  lc1.setLed(0, 3, 3, true); // Light a single LED 
  delay(2000);
  lc1.clearDisplay(0);
  
  lc2.setLed(0, 3, 3, true); // Light a single LED 
  delay(2000);
  lc2.clearDisplay(0);
  
  
  lc3.setLed(0, 3, 3, true); // Light a single LED 
  delay(2000);
  lc3.clearDisplay(0);
  
  
  lc4.setLed(0, 3, 3, true); // Light a single LED 
  delay(2000);
  lc4.clearDisplay(0);
} 

See if this is what you need:

#include <LedControl.h>

// Matrix Control Pins
#define CLK 13
#define DIN 11
#define CS 10

// LedControl instances - Only 3 now
LedControl lc1 = LedControl(DIN, CLK, CS, 0);
//LedControl lc2 = LedControl(DIN, CLK, CS, 1);
//LedControl lc3 = LedControl(DIN, CLK, CS, 2);
//LedControl lc4 = LedControl(DIN, CLK, CS, 3);

void setup() {
  // Initialize matrices (adjusting intensity as needed)
  lc1.shutdown(0, false); lc1.setIntensity(0, 3); lc1.clearDisplay(0);
  lc1.shutdown(1, false); lc1.setIntensity(1, 3); lc1.clearDisplay(1);
  lc1.shutdown(2, false); lc1.setIntensity(2, 3); lc1.clearDisplay(2);
  lc1.shutdown(3, false); lc1.setIntensity(3, 3); lc1.clearDisplay(3);
//  lc2.shutdown(0, false); lc2.setIntensity(0, 3); lc2.clearDisplay(0);
//  lc3.shutdown(0, false); lc3.setIntensity(0, 3); lc3.clearDisplay(0);
//  lc4.shutdown(0, false); lc4.setIntensity(0, 3); lc4.clearDisplay(0);

}

void loop() {
  lc1.setLed(0, 3, 3, true); // Light a single LED 
  delay(2000);
  lc1.clearDisplay(0);
  
  lc1.setLed(1, 3, 3, true); // Light a single LED 
  delay(2000);
  lc1.clearDisplay(1);
  
  
  lc1.setLed(2, 3, 3, true); // Light a single LED 
  delay(2000);
  lc1.clearDisplay(2);
  
  
  lc1.setLed(3, 3, 3, true); // Light a single LED 
  delay(2000);
  lc1.clearDisplay(3);
}

Thankyou,

I've changed it so it now does all the LEDs within on Matrix.

#include <LedControl.h>

// Matrix Control Pins
#define CLK 13
#define DIN 11
#define CS 10
/*
// Button Pins (Assuming these haven't changed)
const int buttonPin3 = 3;
const int buttonPin4 = 4;
const int buttonPin5 = 5;
const int buttonPin6 = 6;

// LED Pin
const int ledPin = 2;
*/
// LedControl instances - Only 3 now
LedControl lc = LedControl(DIN, CLK, CS, 4); //Defines 4 Matrices are used

void setup() {
  // Initialize matrices (adjusting intensity as needed)
  lc.shutdown(0, false); lc.setIntensity(0, 3); lc.clearDisplay(0);
  lc.shutdown(1, false); lc.setIntensity(1, 3); lc.clearDisplay(1);
  lc.shutdown(2, false); lc.setIntensity(2, 3); lc.clearDisplay(2);
  lc.shutdown(3, false); lc.setIntensity(3, 3); lc.clearDisplay(3);

 /*
  // Set button pins as inputs 
  pinMode(buttonPin3, INPUT);
  pinMode(buttonPin4, INPUT);
  pinMode(buttonPin5, INPUT);
  pinMode(buttonPin6, INPUT);

  // Set LED pin as output
  pinMode(ledPin, OUTPUT);
  */
}

void loop() {
  for (int matrixIndex = 0; matrixIndex < 5; matrixIndex++) {
    // Turn off all other matrices
    for (int i = 0; i < 5; i++) {
      if (i != matrixIndex) { 
        lc.clearDisplay(i);
      }
    }

    // Light up the current matrix
    for (int row = 0; row < 8; row++) {
      lc.setRow(matrixIndex, row, 0xFF); 
    }

    delay(1000); // Hold for 1 second
  } 
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.