# FC16-HW control each LED

**URL:** <https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706>\
**Category:** LEDs and Multiplexing\
**Created:** [July 27, 2022, 4:23pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706 "2022-07-27T16:23:44Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![xavier91](https://avatars.discourse-cdn.com/v4/letter/x/3bc359/32.png) [@xavier91](https://forum.arduino.cc/u/xavier91)\
**Post date:** [July 27, 2022, 4:23pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/1 "2022-07-27T16:23:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cncnotes](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/cncnotes/32/1098836_2.png) [@cncnotes](https://forum.arduino.cc/u/cncnotes)\
**Post date:** [July 27, 2022, 4:40pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/2 "2022-07-27T16:40:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![xavier91](https://avatars.discourse-cdn.com/v4/letter/x/3bc359/32.png) [@xavier91](https://forum.arduino.cc/u/xavier91)\
**Post date:** [July 27, 2022, 5:06pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/4 "2022-07-27T17:06:57Z")

</div>

```cpp

#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);
      
}
 }

```

---

<div class="post-metadata">

**Author:** ![groundFungus](https://avatars.discourse-cdn.com/v4/letter/g/73ab20/32.png) [@groundFungus](https://forum.arduino.cc/u/groundFungus)\
**Post date:** [July 27, 2022, 5:11pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/5 "2022-07-27T17:11:11Z")

</div>

**[Read the forum guidelines](https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/679966#posting-code-and-common-code-problems)** 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.  
 ![code tags new](https://europe1.discourse-cdn.com/arduino/original/4X/4/7/0/47090818c9d4d7d934b4b44ab7b96e834ea3164c.jpeg)

---

<div class="post-metadata">

**Author:** ![groundFungus](https://avatars.discourse-cdn.com/v4/letter/g/73ab20/32.png) [@groundFungus](https://forum.arduino.cc/u/groundFungus)\
**Post date:** [July 27, 2022, 5:12pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/6 "2022-07-27T17:12:39Z")

</div>

> [@xavier91](#):
>
> I cascaded four 8\*32 LED array, but I can't control the back two,

Do you have enough power to run that many LEDs?

---

<div class="post-metadata">

**Author:** ![xavier91](https://avatars.discourse-cdn.com/v4/letter/x/3bc359/32.png) [@xavier91](https://forum.arduino.cc/u/xavier91)\
**Post date:** [July 27, 2022, 5:16pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/7 "2022-07-27T17:16:54Z")

</div>

yes, I test the sample code, it works.  
I wonder if LEDCONTROL library can only control 8 led dot matrix.

---

<div class="post-metadata">

**Author:** ![xavier91](https://avatars.discourse-cdn.com/v4/letter/x/3bc359/32.png) [@xavier91](https://forum.arduino.cc/u/xavier91)\
**Post date:** [July 27, 2022, 5:19pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/8 "2022-07-27T17:19:07Z")

</div>

yeah I fix it, please see it again

---

<div class="post-metadata">

**Author:** ![groundFungus](https://avatars.discourse-cdn.com/v4/letter/g/73ab20/32.png) [@groundFungus](https://forum.arduino.cc/u/groundFungus)\
**Post date:** [July 27, 2022, 5:19pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/9 "2022-07-27T17:19:36Z")

</div>

Thanks.

---

<div class="post-metadata">

**Author:** ![xavier91](https://avatars.discourse-cdn.com/v4/letter/x/3bc359/32.png) [@xavier91](https://forum.arduino.cc/u/xavier91)\
**Post date:** [July 27, 2022, 5:24pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/10 "2022-07-27T17:24:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![groundFungus](https://avatars.discourse-cdn.com/v4/letter/g/73ab20/32.png) [@groundFungus](https://forum.arduino.cc/u/groundFungus)\
**Post date:** [July 27, 2022, 5:26pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/11 "2022-07-27T17:26:58Z")

</div>

> [@xavier91](#):
>
> I wonder if LEDCONTROL library can only control 8 led dot matrix.

From the[LedControl library reference:](http://wayoda.github.io/LedControl/pages/software)

> 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.

---

<div class="post-metadata">

**Author:** ![xavier91](https://avatars.discourse-cdn.com/v4/letter/x/3bc359/32.png) [@xavier91](https://forum.arduino.cc/u/xavier91)\
**Post date:** [July 27, 2022, 5:30pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/12 "2022-07-27T17:30:35Z")

</div>

> [@groundFungus](#):
>
> 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

---

<div class="post-metadata">

**Author:** ![xavier91](https://avatars.discourse-cdn.com/v4/letter/x/3bc359/32.png) [@xavier91](https://forum.arduino.cc/u/xavier91)\
**Post date:** [July 27, 2022, 5:32pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/13 "2022-07-27T17:32:10Z")

</div>

could you show me the code about how I can control each led when I have 16 daisy chained MAX7219 drivers

---

<div class="post-metadata">

**Author:** ![groundFungus](https://avatars.discourse-cdn.com/v4/letter/g/73ab20/32.png) [@groundFungus](https://forum.arduino.cc/u/groundFungus)\
**Post date:** [July 27, 2022, 5:32pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/14 "2022-07-27T17:32:45Z")

</div>

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](https://majicdesigns.github.io/MD_MAX72XX/index.html), but will look.

```cpp
#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()
{

}

```

---

<div class="post-metadata">

**Author:** ![xavier91](https://avatars.discourse-cdn.com/v4/letter/x/3bc359/32.png) [@xavier91](https://forum.arduino.cc/u/xavier91)\
**Post date:** [July 27, 2022, 5:34pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/15 "2022-07-27T17:34:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![groundFungus](https://avatars.discourse-cdn.com/v4/letter/g/73ab20/32.png) [@groundFungus](https://forum.arduino.cc/u/groundFungus)\
**Post date:** [July 27, 2022, 5:39pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/16 "2022-07-27T17:39:12Z")

</div>

Here is the MD\_MAX72xx library reference. It explains all of the functions.

> [@xavier91](#):
>
> What is the mx.setPoint means (the number in it)

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).

> [@xavier91](#):
>
> And what should I write in loop function to control each led

Read the reference.

---

<div class="post-metadata">

**Author:** ![xavier91](https://avatars.discourse-cdn.com/v4/letter/x/3bc359/32.png) [@xavier91](https://forum.arduino.cc/u/xavier91)\
**Post date:** [July 27, 2022, 5:58pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/17 "2022-07-27T17:58:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![xavier91](https://avatars.discourse-cdn.com/v4/letter/x/3bc359/32.png) [@xavier91](https://forum.arduino.cc/u/xavier91)\
**Post date:** [July 27, 2022, 6:02pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/18 "2022-07-27T18:02:07Z")

</div>

> [@groundFungus](#):
>
> MD\_MAX72xx library reference

Besides, could you please tell me where I could find the reference of MD\_MAX72xx

---

<div class="post-metadata">

**Author:** ![groundFungus](https://avatars.discourse-cdn.com/v4/letter/g/73ab20/32.png) [@groundFungus](https://forum.arduino.cc/u/groundFungus)\
**Post date:** [July 27, 2022, 6:05pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/19 "2022-07-27T18:05:32Z")

</div>

[The MD\_MAX72xx library reference.](https://majicdesigns.github.io/MD_MAX72XX/class_m_d___m_a_x72_x_x.html) Sorry, I though that I linked it in a prior post.

EDIT: I did link the reference in post #14.

---

<div class="post-metadata">

**Author:** ![groundFungus](https://avatars.discourse-cdn.com/v4/letter/g/73ab20/32.png) [@groundFungus](https://forum.arduino.cc/u/groundFungus)\
**Post date:** [July 27, 2022, 6:07pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/20 "2022-07-27T18:07:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![xavier91](https://avatars.discourse-cdn.com/v4/letter/x/3bc359/32.png) [@xavier91](https://forum.arduino.cc/u/xavier91)\
**Post date:** [July 27, 2022, 6:10pm UTC](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706/21 "2022-07-27T18:10:27Z")

</div>

Really appreciate！  
Sorry for the trouble, I don't know how to delete the prior post.

[Next page](https://forum.arduino.cc/t/fc16-hw-control-each-led/1016706.md?page=2)
