# i1旋鈕模組

## 實體照片

![](/files/-LaxNdNsui8IUEUv0QwJ)

## 基本信息

中文名稱：旋鈕模組

英文名稱：Rotation Sensor

編號：i1

SKU：BOS0001

## 功能簡介

旋鈕模組是基於電位器的旋轉角度感測器，旋轉角度從0到300度，可以非常容易地實現與旋轉位置相關的互動效果。旋鈕可廣泛應用於調速風扇、換擋汽車、家用洗衣機等。這是一款非常基本的類比訊號輸入裝置，你可以通過它來學習類比訊號的處理，進而學習更多類比感測器。

![](/files/-LaxOTs8vt3o1bBDlAg2)

## 使用說明

旋鈕模組上帶有旋轉箭頭標識，在使用時通過調節旋鈕角度即可控制類比訊號輸入的大小。以旋鈕控制風扇為例：

> * 順時針旋轉代表類比訊號增強，風扇會轉得愈來愈快；逆時針旋轉代表類比訊號減弱，風扇會變慢。

![](/files/-LaxLGNKlbcLg-_rsn2Q)

## 原理介紹

旋鈕模組通過調節旋鈕，在一定範圍內改變電阻值，從而改變輸出訊號的大小。

## 實作範例教學-基本篇

### 變速風扇

**範例說明：**&#x901A;過轉動旋鈕到不同的角度來控制風扇轉動速度。順時針旋轉，風扇轉速增大；逆時針旋轉，風扇轉速降低。

**元件清單：**&#x65CB;鈕模組；風扇模組；主控板：3組輸入/輸出端。

**連線圖：**

![](/files/-LaxOTsA6we9VoIr2bTd)

### 調速打蛋器

**範例說明：**&#x88FD;作一個打蛋器，打蛋器的打蛋頭固定在馬達的轉軸上，使用旋鈕模組控制馬達的轉速。

**元件清單：**&#x65CB;鈕模組；馬達模組；主控板：1組輸入/輸出端。

**連線圖：**

![](/files/-LaxOTsISu6nwbSUu12B)

## 實作範例教學-Micro:bit篇

### (2) 旋鈕檯燈

**範例說明：**&#x4F7F;用旋鈕控制LED燈模組的亮度。順時針轉動旋鈕，LED燈模組越來越亮，逆時針轉動旋鈕，LED燈模組越來越暗。

**元件清單：**&#x65CB;鈕模組；LED燈模組；Micro:bit；Micro:bit BOSON 擴充板。

**連線圖：**&#x5C07;旋鈕模組連接至Micro:bit擴充板的P0腳位，LED燈模組連接到Micro:bit擴充板的P8腳位。

![](/files/-LaxOTsC_ludvbGcOyMA)

**程式說明：**&#x2460; 讀取P0腳位的類比值；② 將讀取到的類比值賦給P8腳位。

**程式示意圖（中文版）：**

![](/files/-LaxOTsEwiCnsfSe3ZMC)

**Example program(English):**

![](/files/-LaxOTsGi8mPm6H1zlb4)

## 商品規格

腳位說明：

![](/files/-LaxOTsKTXkVEOSDwQS0)

| **編號** | **名稱** | **功能說明** |
| :----: | :----: | :------: |
|    1   |   GND  |   電源接地   |
|    2   |   VCC  |   電源正極   |
|    3   |    A   |   類比訊號   |

重量： （g）

尺寸：26mm\*22mm

工作電壓：3.0-5.5V

工作電流：(Max)1mA\@5V


---

# 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/boson/boson_intro/input_modules/rotation_sensor.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.
