> For the complete documentation index, see [llms.txt](https://yanweiliu.gitbook.io/arduino/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yanweiliu.gitbook.io/arduino/ji-ben-jie-shao/6zhi-ling-jie-shao.md).

# 6.常用指令介紹

1.pinMode(pin,mode):指定第幾腳位，輸入或輸出\
例如:pinMode(13,OUTPUT):設定第13腳位為輸出

2.digitalWrite(pin,value):指定第幾腳位，HIGH或LOW\
例如:digitalWrite(13,LOW):設定第13腳位為低電位(0V)

3.analogWrite(pin,value):只支援PWM類比接腳(3,5,6,9,10,11)，0\~255\
例如:analogWrite(3,128):設定第3腳位為128，128為脈衝時間

4.delay(ms):延遲1毫秒時間\
例如:delay(1000):延遲1秒

5.Serial.begin(串列傳輸速率):設定每秒傳輸資料的速率

例如:Serial.begin(9600)

6.Serial.read():讀取序列阜收到的資料

7.Serial.print(資料)

例如:Serial.print(66)會顯示"66"

8.Serial.println(資料):用於換行


---

# 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:

```
GET https://yanweiliu.gitbook.io/arduino/ji-ben-jie-shao/6zhi-ling-jie-shao.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.
