samples/sensor/proximity_polling/README.html · samples/sensor/proximity_polling/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Samples · Sensor · Proximity

Generic proximity sensor sample

prox-sensor alias로 sensor를 자동 감지하고 각 device의 proximity 값을 읽습니다.

Official pathsamples/sensor/proximity_polling/README.html
Source filesamples/sensor/proximity_polling/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

Alias 범위, TMD2620 overlay, generic board build와 실제 출력을 보존합니다.

Capacity

Up to 10 sensors

Alias

prox-sensor-0..9

Example

TMD2620

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 A4608E4123FEC45B7F0C4897B1B07A978468C1CFFA3BC089EDBB551FC89F6702
.. _tmd2620:

Generic Proximity Sensor Sample
###############################

Overview
********

This sample demonstrates how to use one or multiple proximity sensors.

Building and Running
********************

The sample supports up to 10 proximity sensors. The number of the sensors will
automatically detected from the devicetree, you only need to set aliases from
``prox-sensor-0`` to ``prox-sensor-9``.

For example:

.. code-block:: devicetree

   / {
              aliases {
                      prox-sensor0 = &tmd2620;
              };
   };

After creating the devicetree overlay you can build the sample with:

.. zephyr-app-commands::
   :zephyr-app: samples/sensor/proximity_polling
   :board: <your_board>
   :goals: build flash
   :compact:

Sample Output
=============

.. code-block:: console

   *** Booting Zephyr OS build zephyr-v3.2.0-210-gd95295f08646  ***
   Proximity sensor sample application
   Found 1 proximity sensor(s): tmd2620@29
   Proximity on tmd2620@29: 202
   Proximity on tmd2620@29: 205
   Proximity on tmd2620@29: 204
   Proximity on tmd2620@29: 60
   Proximity on tmd2620@29: 1

Part 3

한국어 전문 번역

개요

이 sample은 proximity sensor 하나 또는 여러 개를 사용하는 방법을 보여 줍니다.

빌드 및 실행

Sample은 최대 10개의 proximity sensor를 지원합니다. Sensor 수는 Devicetree에서 자동으로 감지되므로 prox-sensor-0부터 prox-sensor-9까지 alias만 설정하면 됩니다.

예를 들어 TMD2620 하나를 등록하는 overlay는 다음과 같습니다.

/ {
           aliases {
                   prox-sensor0 = &tmd2620;
           };
};

Devicetree overlay를 만든 뒤 다음과 같이 sample을 build하고 flash할 수 있습니다.

west build -b <your_board> samples/sensor/proximity_polling
west flash

출력 예

*** Booting Zephyr OS build zephyr-v3.2.0-210-gd95295f08646  ***
Proximity sensor sample application
Found 1 proximity sensor(s): tmd2620@29
Proximity on tmd2620@29: 202
Proximity on tmd2620@29: 205
Proximity on tmd2620@29: 204
Proximity on tmd2620@29: 60
Proximity on tmd2620@29: 1

예시는 address 0x29의 tmd2620 하나를 찾아 proximity raw value가 202에서 1까지 변하는 모습을 보여 줍니다.

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.