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

### 코드

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

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

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

***

### 설명

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

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

***

### 주의사항

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

***

### 파이썬 대응 코드

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

***

### 예시

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

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

{% endcode %}

***

### 검색 키워드

pinMode


---

# 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://codebook.horang.it/arduino/026.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.
