Hey there everyone, this is my first time posting and I am a newbie when it comes to electronics so I apologize if some of this does not make sense.
I am using a Photon 2 to power 3 daisy-chained MAX7219 4in1 8x8 modules. I am hoping to display live sports scores on it using a webhook I've set up with a web server.
Using the LedControl-MAX7219-MAX7221.h library, I was able to daisy-chain two of these modules together no problem, however once I soldered the third on I began running into my problem. Essentially, the third module (right-most) replicates whatever information the first module is displaying at all times (I will add a photo for reference).
Here is my code:
#include <LedControl-MAX7219-MAX7221.h>
// Pins for LED matrix
const int DIN = D0; // Data In
const int CLK = D2; // Clock
const int CS = D1; // Chip Select
const int NUM_MATRICES = 12; // Total number of matrices
LedControl lc = LedControl(DIN, CLK, CS, NUM_MATRICES);
void setup() {
Serial.begin(9600);
for (int matrix = 0; matrix < NUM_MATRICES; matrix++) {
lc.shutdown(matrix, false);
lc.setIntensity(matrix, 8);
lc.clearDisplay(matrix);
}
}
void loop() {
const char* gameInfo = "PHX 80 v DEN 95 Q3 3:45 ";
displayText(gameInfo);
delay(10000); // Display each segment for 10 seconds
}
void displayText(const char* text) {
int textLength = strlen(text); // Length of the text
for (int i = 0; i < textLength; i++) {
// Clear all displays before showing the next character
for (int matrix = 0; matrix < NUM_MATRICES; matrix++) {
lc.clearDisplay(matrix);
}
// Display text across the matrices
for (int matrix = 0; matrix < NUM_MATRICES; matrix++) {
int charIndex = i + matrix; // Index of the character in the text string
if (charIndex < textLength) {
for (int col = 0; col < 8; col++) {
byte character = text[charIndex];
byte columnData = cp437_font[character][7 - col]; // Correctly oriented
lc.setColumn(matrix, col, columnData);
Serial.print("Matrix: "); Serial.print(matrix);
Serial.print(", Char: "); Serial.print(character);
Serial.print(", Col: "); Serial.println(col);
}
}
}
delay(300); // Display this character for a short time before moving to the next
}
}
and here is a photo of the issue:
I have tried debugging by sending unique information to both the first and third modules, but the third continues to mirror the first. I also looked through the library's documentation and it seems that it is capable of handling up to 8 of these modules.
Does anyone have any experience with this issue / ideas on how to fix it?
Thanks so much in advance!!