I am hoping someone here can help me or point me in the right direction. I do not have a lot of experience in programming, but for the most part, I have been able to copy and paste and make the majority of my projects work, but this 8x8 matrix project is kicking my butt.
I have 4 8x8 Max72xx matrix displays hooked up together. I have tried numerous things but I cannot figure out how to get them to scroll the text. When I upload the sketch all the matrices display the exact same thing on all of them.
I believe this is the original code that I used from here
#include <LedControl.h>
const int DIN_PIN = 12;
const int CS_PIN = 10;
const int CLK_PIN = 11;
const byte IMAGES[][8] = {
{
0b11111111,
0b00000000,
0b00000000,
0b10000000,
0b10000000,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b11000000,
0b11000000,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b01100000,
0b01100000,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00110000,
0b00110000,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00011000,
0b00011000,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00001100,
0b00001100,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00000110,
0b00000110,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00000011,
0b00000011,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00000001,
0b00000001,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00000011,
0b00000011,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00000110,
0b00000110,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00011000,
0b00011000,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00110000,
0b00110000,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b01100000,
0b01100000,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b11000000,
0b11000000,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b10000000,
0b10000000,
0b00000000,
0b00000000,
0b11111111
}};
const int IMAGES_LEN = sizeof(IMAGES)/8;
LedControl display = LedControl(DIN_PIN, CLK_PIN, CS_PIN);
void setup() {
display.clearDisplay(0);
display.shutdown(0, false);
display.setIntensity(0, 5);
}
void displayImage(const byte* image) {
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
display.setLed(0, i, j, bitRead(image[i], 7 - j));
}
}
}
int i = 0;
void loop() {
displayImage(IMAGES[i]);
if (++i >= IMAGES_LEN ) {
i = 0;
}
delay(333);
}
Is there a way for me to update this to take advantage of multiple matrices or am I barking up the wrong tree? I would prefer to keep this code if possible because I would like to use the matrix editor to make the animations.
Thanks in advance.