# \[아두이노] 기압 센서 코드

### 코드

{% code title="기압을 읽어올 때" %}

```
@아두이노 기압 읽어오기
```

{% endcode %}

{% code title="온도를 읽어올 때" %}

```
@아두이노 기압센서 온도 읽어오기
```

{% endcode %}

***

### 설명

<mark style="color:purple;">`기압센서 기압/온도 읽어오기`</mark>는 아두이노와 연결된 기압 센서와의 기압과 온도 데이터를 읽어오는 코드예요.

기압센서는 온도 센서도 포함하고 있어요. 기압을 보정할 때 활용되기 때문이에요.

***

### 주의사항

* 별도의 핀 모드 설정이 필요없어요.
  * I2C 기술을 사용하여 데이터를 가져오기에, SCL과 SDA 포트에 연결하여 사용해요. 따라서 별도로 핀 모드를 설정하지 않아도 돼요.&#x20;
  * 더 자세한 내용이 궁금하다면, [아두이노](/arduino/025.md)를 참고해 주세요.
* 기압은 30,000Pa\~110,000Pa까지 읽어올 수 있어요. (일부 센서는 저 범위를 넘어서 읽어올 수 있음)
  * 땅에서의 기압은 보통 100,000Pa이에요. 높아질수록 기압 값은 작아져요.
* 온도는 -40\~85도까지 읽어올 수 있어요. (일부 센서는 저 범위를 넘어서 읽어올 수 있음)
  * 영하는 -가 붙은 채로 읽어와요.

***

### 파이썬 대응 코드

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

***

### 예시

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

```
(@아두이노 기압 읽어오기) 보여주기
(@아두이노 기압센서 온도 읽어오기) 보여주기
```

{% endcode %}

{% code title="예시 코드의 결과" %}

```
100472
24
```

{% endcode %}

***

### 검색 키워드

높이, 대기압, 날씨


---

# 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/032.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.
