> 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

![](https://3423273789-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjRgHmD322MUgRPOyqMLh%2Fuploads%2Fvvs8jU7SMaBnYNYIHlbk%2Fimage1?alt=media)

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!](https://3423273789-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjRgHmD322MUgRPOyqMLh%2Fuploads%2FThaUUm9TZhAp6uHiw38i%2Fimage.png?alt=media\&token=452b6247-2eda-404f-a446-6b67fcde3cfd)

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>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://guides.mccaskeyrobotics.org/arduino/led-matrix.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
