Hello everyone, I have a stupid question about how to control a single LED. I cascaded four 8*32 LED array, but I can't control the back two, I can only control the front two, please tell me how to solve this problem. How do you light leds one by one.
Welcome to the forum.
Could you please post a link to the actual array you are using, a wiring diagram of how you have connected everything, as well as you entire code in code tags.
#include "LedControl.h"
/*
Now we need a LedControl to work with.
***** These pin numbers will probably not work with your hardware *****
pin 11 is connected to the DataIn
pin 13 is connected to the CLK
pin 10 is connected to LOAD
*/
//LedControl lc=LedControl(11,13,10,16);
/* we always wait a bit between updates of the display */
unsigned long delaytime=50;
/*
This time we have more than one device.
But all of them have to be initialized
individually.
*/
void setup() {
pinMode(ccdPin, OUTPUT);
//we have already set the number of devices when we created the LedControl
// int devices=lc.getDeviceCount();
int devices=16;
//we have to init all devices in a loop
for(int address=0;address<devices;address++) {
/*The MAX72XX is in power-saving mode on startup*/
lc.shutdown(address,false);
/* Set the brightness to a medium values */
lc.setIntensity(address,15);
/* and clear the display */
lc.clearDisplay(address);
}}
void loop() {
int devices=16;
// //read the number cascaded devices
// for(int row=0;row<8;row++) {
// for(int col=0;col<3;col++) {
// int address=0;
// lc.setLed(address,row,col,true);
// }
// delay(1000);
// int address=0;
// lc.shutdown(address,false);
//
// }
for(int address=0;address<devices;address++) {
for(int row=0;row<2;row++) {
for(int col=0;col<2;col++) {
lc.setLed(address,row,col,true); delay(1000);
lc.setLed(address,row,col,false);
}
}
// lc.clearDisplay(address);
// for(int address=0;address<devices;address++) {
// lc.clearDisplay(address);
// }
for(int row=0;row<2;row++) {
for(int col=2;col<4;col++) {
lc.setLed(address,row,col,true);
delay(1000);
lc.clearDisplay(address);
}
}
for(int row=0;row<2;row++) {
for(int col=4;col<6;col++) {
lc.setLed(address,row,col,true);
delay(1000);
lc.clearDisplay(address);
}
}
for(int row=0;row<2;row++) {
for(int col=6;col<8;col++) {
lc.setLed(address,row,col,true);
delay(1000);
lc.clearDisplay(address);
}
}
delay(1000);
}
}
Read the forum guidelines to see how to properly post code and some good information on making a good post.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.
You can go back and fix your original post by highlighting the code and clicking the </> in the menu bar.

Do you have enough power to run that many LEDs?
yes, I test the sample code, it works.
I wonder if LEDCONTROL library can only control 8 led dot matrix.
yeah I fix it, please see it again
Thanks.
it seems the problem is LEDcontol library, how could I use MD_MAX72xx library to control each led. The functionality of this library is too complex, mostly used to demonstrate animation effects. I didn't find some basic control language.
From the LedControl library reference:
A single MAX72XX Led driver is able to control 64 Leds. The library supports up to 8 daisy chained MAX72XX drivers. Controlling 512 Leds should be more than enough for most purposes.
yeah,but now I have 1024 LEDs, which is 16 daisy chained MAX72XX drivers. I can't change that because it is the project requires
could you show me the code about how I can control each led when I have 16 daisy chained MAX7219 drivers
Try this code. Change the number of devices. I only have 2 ea. 8x64 matrices to test with and this works fine with the 8 devices. I don't know the limit for MD_MAX72xx library, but will look.
#include <MD_MAX72xx.h>
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 8
#define CLK_PIN 13 // or SCK
#define DATA_PIN 11 // or MOSI
#define CS_PIN 10 // or SS
// SPI hardware interface
MD_MAX72XX mx = MD_MAX72XX(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
void setup()
{
Serial.begin(115200);
mx.begin();
mx.setPoint(5, 70, 1);
}
void loop()
{
}
thank you so much!
What is the mx.setPoint means (the number in it)
And what should I write in loop function to control each led
Here is the MD_MAX72xx library reference. It explains all of the functions.
It is max.setPoint( row, column, mode) row being the horizontal lines (0-7), column the vertical lines (for 4 8x32 matrices, 0 -127) and mode is LED on (1) or LED off (0).
Read the reference.
thank you so much for your help!!!! I will try how to let 4 leds turn on together each and move them through every MAX7219 drivers
Besides, could you please tell me where I could find the reference of MD_MAX72xx
The MD_MAX72xx library reference. Sorry, I though that I linked it in a prior post.
EDIT: I did link the reference in post #14.
I looked through the library documentation and did not find any limit to the number of LEDs or matrices. The only mention was that there needs to be enough memory for the buffers. I have not found what size the buffers are, though. I guess you will just have to experiment.
You never did answer my question about how the matrices are powered.
Really appreciate!
Sorry for the trouble, I don't know how to delete the prior post.