> 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/hangeekduino/samplecode/input_module/rotarypotentiometer.md).

# 旋轉電位計模組

![](/files/-MITYQ4kwwqnZ6kXwq7I)

## **指令**

![](/files/-MITGCFHP9UqaWG7pFb2)

## **對應的**Arduino 語法

```
analogRead(0);
```

### 範例 BlocklyDuino 積木畫布

根據旋轉電位計模組旋鈕的數值來決定LED燈的延遲時間(閃爍的頻率)。

![](/files/-MITIAdOGyvfwjQkKsrB)

## Arduino 程式

```
void setup()
{

  pinMode(4, OUTPUT);
}


void loop()
{
  digitalWrite(4, 1);
  delay((analogRead(0)));
  digitalWrite(4, 0);
  delay((analogRead(0)));
}
```
