> For the complete documentation index, see [llms.txt](https://codebook.horang.it/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codebook.horang.it/arduino/026.md).

# \[아두이노] 핀 모드 설정

### 코드

```
@아두이노 {핀 번호}번 핀 입력 설정
```

```
@아두이노 {핀 번호}번 핀 디지털 출력 설정
```

```
@아두이노 {핀 번호}번 핀 아날로그 출력 설정
```

***

### 설명

<mark style="color:purple;">`핀 설정`</mark>은 아두이노와 연결된 핀을 어떻게 사용할지 설정해 주는 코드예요.

더 자세한 내용이 궁금하다면, [아두이노](/arduino/025.md)를 참고해 주세요.

***

### 주의사항

* 입력 설정에서 {핀 번호}에 숫자만 쓰면 디지털 핀으로, "A1"과 같이 "A+숫자"를 문자열로 쓰면 아날로그 핀으로 인식해요.
* 디지털 출력 설정은 디지털 핀만 사용 가능해요.
* 아날로그 출력 설정은 PWM 핀만 사용 가능해요.

***

### 파이썬 대응 코드

아두이노 코드는 파이썬에 대응되는 코드가 없어 제공되지 않아요.

***

### 예시

{% code title="예시 코드" %}

```
@아두이노 "A3"번 핀 입력 설정
@아두이노 3번 핀 입력 설정
@아두이노 12번 핀 디지털 출력 설정
@아두이노 6번 핀 아날로그 출력 설정
```

{% endcode %}

***

### 검색 키워드

pinMode
