> For the complete documentation index, see [llms.txt](https://cavedu.gitbook.io/cavedu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cavedu.gitbook.io/cavedu/rk002/module/002_led.md).

# LED模組

![](/files/-LwXV-lO7CcoPDQhRX-V)

## 專案說明

使用「科易KEYES Arduino UNO R3 開發板」連接「LED模組」, 每2秒鐘LED模組閃爍一次。

此**LED模組**包含&#x65BC;**「**[洞洞兩教學材料包 Education Kit 002](https://www.robotkingdom.com.tw/product/rk-education-kit-002/)**」**&#x5167;。

## 電路圖

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

**LED模組**是**數位/類比訊號**輸出， 可以接「D0 \~ D13」的 KEYES Arduino UNO R3訊號端上。 本範例連接到「**D3」**

![](/files/-LwXV-lPX474bJ8tuuCP)

## Arduino 程式

將3號腳位的電位拉低、拉高，每2秒鐘會切換**LED**的亮暗一次。

產生出的 Arduino 程式如下

```c
void setup()
{
 pinMode(3, OUTPUT);
}
void loop()
{
 digitalWrite(3, HIGH);
 delay(1000);
 digitalWrite(3, LOW);
 delay(1000);
}
```


---

# 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 dynamically by asking a question.

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

```
GET https://cavedu.gitbook.io/cavedu/rk002/module/002_led.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
