> 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/undefined-1.md).

# \[아두이노] 레이저 거리 센서 코드

### 코드

```
@아두이노 레이저 거리 재기
```

***

### 설명

* `@아두이노 레이저 거리 재기`는 아두이노와 연결된 레이저 거리 센서(ToF/거리 측정 센서)로부터 물체까지의 거리를 읽어오는 코드예요.
* 측정 결과는 mm(밀리미터) 단위로 반환돼요.

***

### 주의사항

* 자이로 센서는 주로 I2C 통신을 사용하므로, 아두이노의 I2C 핀(SDA/SCL)에 올바르게 연결해야 해요.
* 반사율이 낮은 검은색 물체나 투명한 물체는 측정값이 흔들릴 수 있어요.
* 결과값은 mm 단위 정수로 사용해요. (예: 250 = 250mm)

### 파이썬 대응 코드

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

***

### 예시

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

```
거리 = @아두이노 레이저 거리 재기
거리 + "mm" 보여주기
```

{% endcode %}

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

```
500mm
(센서부터 앞의 물체까지의 거리가 500mm(=50cm)이다.)
```

{% endcode %}

***

### 검색 키워드

레이저 거리 센서, ToF 센서, 거리 측정 센서, VL53L0X, I2C 거리센서


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/undefined-1.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.
