# Max7219 8X8 矩陣LED模組

![](/files/-Lx08nbETEONyrHUMyo_)

## 專案說明

使用「科易KEYES Arduino UNO R3 開發板」連接「Max7219 8X8 矩陣LED模組」, 在Max7219 8X8 矩陣LED模組上顯示「Hello World」。

此**Max7219 8X8 矩陣LED模組**包含於「[洞洞兩教學材料包 Education Kit 002](https://www.robotkingdom.com.tw/product/rk-education-kit-002/)」內。

## KEYES Arduino UNO R3電路圖

* [KEYES Arduino UNO R3&#x20;  ](https://www.robotkingdom.com.tw/product/keyes-uno-r3/)
* 通用型彩色Sensor shield v5.0感測器擴充板
* Max7219 8X8 矩陣LED模組

**Max7219 8X8 矩陣LED模組**是**數位訊號**輸出， 可以接「D0 \~ D13」的 KEYES Arduino UNO R3訊號端上。 本範例連接到「**D5**」←→「**dataPin**」，「**D4**」**←→**「**csPin**」，「**D3**」**←→**「**clkPin**」

![](/files/-Lx09_HTKTbu0GeocC8J)

## Arduino 程式

由於Max7219 8X8 矩陣LED模組是函式庫型模組，所以需要先在Arduino上下載函式庫，下載方法如下。

在Arduino上選擇工具，選擇管理程式庫，在管理程式庫搜尋MatrizLed選擇MatrizLed by Daniel Alvarez版本2.0.3並安裝。

![](/files/-Lx09oZ9YeIo-1FelskQ)

![](/files/-Lx09t8QEei4Z1nSxiCs)

在Max7219 8X8 矩陣LED模組上間隔0.2秒由右至左以跑馬燈的形式顯示「Hello World」文字 。

產生出的 Arduino 程式如下

```c
#include <MatrizLed.h>
MatrizLed pantalla;

void setup() {
  pantalla.begin(5, 3, 4, 2); // dataPin, clkPin, csPin, numero de matrices de 8x8
}

void loop() { 
  pantalla.borrar();
  pantalla.escribirFraseScroll("Hello World", 200); 
}

```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cavedu.gitbook.io/cavedu/rk002/module/002_max7219.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
