# 旋轉電位計模組

## 旋轉電位計模組 <a href="#hlk124882073" id="hlk124882073"></a>

**專案說明**

使用「Raspberry Pi Pico W」連接「旋轉電位計模組」, 讀取旋轉電位計模組的數值變化。此 **旋轉電位計模組**包含於「洞洞五教學材料包」內。

### **旋轉電位計模組電路圖**

* Raspberry Pi Pico W
* Raspberry Pi Pico W 擴充板
* 旋轉電位計模組

**旋轉電位計模組**是**類比訊號**輸入， 可以接「A0\~ A2」的Raspberry Pi Pico擴充板訊號端上。 本範例連接到「A0」

![](/files/jKVMRsVIp8VMl5JfMvad)

### **BlocklyDuino 程式 (Potentiometer)**

每0.5秒鐘會讀取旋轉電位計模組的電位一次， 並顯示在序列埠監控視窗上。

![](/files/GP83tKFqSS0UbwVipNiq)

### **Arduino 程式(Potentiometer.ino)如下**

```
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println(analogRead(A0));
delay(500);
}
```

### **程式執行結果:**

![](/files/yRGlsuqRvh9PKb1k5Jfe)


---

# 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/rk005/module_ui/potentiometer.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.
