> For the complete documentation index, see [llms.txt](https://guides.mccaskeyrobotics.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guides.mccaskeyrobotics.org/arduino/led-matrix.md).

# LED Matrix

LED Matrix

![](/files/PDShItDL1RZNDjA96QSe)

Wiring Diagram:&#x20;

| LED Matrix | Arduino |
| ---------- | ------- |
| GND        | GND     |
| VCC        | 5V      |
| DIN        | 12      |
| CLK        | 11      |
| CS         | 10      |

![Install this library before trying to run your code!](/files/RtWjVuy310FTsSEKuPpA)

Code: &#x20;

```
/* To install this library, go to
  Sketch --> Include Library--> Manage Libraries
  now search for "LedControl"
  Choose install
*/
#include "LedControl.h"

LedControl lc = LedControl(12, 11, 10, 1);
/* we always wait a bit between updates of the display */ unsigned long delaytime = 500;
void setup() {
  /*
    The MAX72XX is in power-saving mode on startup,
    we have to do a wakeup call
  */
  lc.shutdown(0, false);
  /* Set the brightness to a medium values */  lc.setIntensity(0, 8);
  /* and clear the display */
  lc.clearDisplay(0);
}
void loop() {
  lc.setRow(0, 0, B11111111);
  lc.setRow(0, 1, B10000001);
  lc.setRow(0, 2, B10000001);
  lc.setRow(0, 3, B10000001);
  lc.setRow(0, 4, B10000001);
  lc.setRow(0, 5, B10000001);
  lc.setRow(0, 6, B10000001);
  lc.setRow(0, 7, B11111111);
  delay(delaytime);
  lc.setRow(0, 0, B00000000);
  lc.setRow(0, 1, B01111110);
  lc.setRow(0, 2, B01000010);
  lc.setRow(0, 3, B01000010);
  lc.setRow(0, 4, B01000010);
  lc.setRow(0, 5, B01000010);
  lc.setRow(0, 6, B01111110);
  lc.setRow(0, 7, B00000000);
  delay(delaytime);
  lc.setRow(0, 0, B00000000);
  lc.setRow(0, 1, B00000000);
  lc.setRow(0, 2, B00111100);
  lc.setRow(0, 3, B00100100);
  lc.setRow(0, 4, B00100100);
  lc.setRow(0, 5, B00111100);
  lc.setRow(0, 6, B00000000);
  lc.setRow(0, 7, B00000000);
  delay(delaytime);
  lc.setRow(0, 0, B00000000);
  lc.setRow(0, 1, B00000000);
  lc.setRow(0, 2, B00000000);
  lc.setRow(0, 3, B00011000);
  lc.setRow(0, 4, B00011000);
  lc.setRow(0, 5, B00000000);
  lc.setRow(0, 6, B00000000);
  lc.setRow(0, 7, B00000000);
  delay(delaytime);
  lc.setRow(0, 0, B00000000);
  lc.setRow(0, 1, B00000000);
  lc.setRow(0, 2, B00111100);
  lc.setRow(0, 3, B00100100);
  lc.setRow(0, 4, B00100100);
  lc.setRow(0, 5, B00111100);
  lc.setRow(0, 6, B00000000);
  lc.setRow(0, 7, B00000000);
  delay(delaytime);
  lc.setRow(0, 0, B00000000);
  lc.setRow(0, 1, B01111110);
  lc.setRow(0, 2, B01000010);
  lc.setRow(0, 3, B01000010);
  lc.setRow(0, 4, B01000010);
  lc.setRow(0, 5, B01000010);
  lc.setRow(0, 6, B01111110);
  lc.setRow(0, 7, B00000000);
  delay(delaytime);
  lc.setRow(0, 0, B11111111);
  lc.setRow(0, 1, B10000001);
  lc.setRow(0, 2, B10000001);
  lc.setRow(0, 3, B10000001);
  lc.setRow(0, 4, B10000001);
  lc.setRow(0, 5, B10000001);
  lc.setRow(0, 6, B10000001);
  lc.setRow(0, 7, B11111111);
  delay(delaytime);
}
```

More advanced programming stratgies for these LED Matrix can be found at: <https://xantorohara.github.io/led-matrix-editor/#samples>
