Part 1
요약·해설
I2C·INT wiring, 누락된 board parameter와 두 phase 출력을 설명합니다.
300 ms · 5 sec
127
Feather D5
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
E5E6EE6C28406B54BEF468A5162ACB51F6746D5299FC0991E11F43CC2B45BD11
.. _vcnl4040_sample:
VCNL4040: proximity and ambient light sensor
############################################
Overview
********
This sample periodically measures proximity and light for
5 sec in the interval of 300msec in polling mode. Then threshold trigger mode
is enabled with the high threshold value of 127 and data is fetched based
on interrupt. The result is displayed on the console.
Requirements
************
This sample uses the VCNL4040 sensor controlled using the I2C interface.
Connect sensor INT for interrupt to Feather D5 pin on the Adafruit STM32F405 Feather.
References
**********
- VCNL4040: https://www.vishay.com/docs/84274/vcnl4040.pdf
Building and Running
********************
This project outputs sensor data to the console. It requires a VCNL4040
sensor to be connected to the desired board.
.. zephyr-app-commands::
:app: samples/sensor/vcnl4040/
:goals: build flash
Sample Output
=============
.. code-block:: console
get device vcnl4040
Testing the polling mode.
Proximity: 31
Light (lux): 288
<repeats for 5sec every 300ms>
Polling mode test finished.
Testing the trigger mode.
Testing proximity trigger.
...
Triggered.
Proximity: 122
<repeats whenever triggered for 5sec>
Threshold trigger test finished.
Trigger mode test finished.
Part 3
한국어 전문 번역
개요
이 sample은 polling mode에서 300 ms 간격으로 5초 동안 proximity와 light를 측정합니다. 이어서 high-threshold value를 127로 둔 threshold-trigger mode를 활성화하고 interrupt에 따라 data를 가져와 console에 표시합니다.
요구 사항
이 sample은 I2C interface로 제어하는 VCNL4040 sensor를 사용합니다. Adafruit STM32F405 Feather에서는 interrupt용 sensor INT를 Feather D5 pin에 연결하십시오.
참고 자료
빌드 및 실행
이 project는 sensor data를 console에 출력하며 원하는 board에 VCNL4040 sensor를 연결해야 합니다.
공식 source directive에는 board가 지정되지 않아 아래 보존된 rendered command에는 -b None이 나타납니다. 실제 실행 시 None을 VCNL4040을 연결한 board 이름으로 바꾸어야 합니다.
west build -b None samples/sensor/vcnl4040/
west flash
출력 예
get device vcnl4040
Testing the polling mode.
Proximity: 31
Light (lux): 288
<repeats for 5sec every 300ms>
Polling mode test finished.
Testing the trigger mode.
Testing proximity trigger.
...
Triggered.
Proximity: 122
<repeats whenever triggered for 5sec>
Threshold trigger test finished.
Trigger mode test finished.
Polling phase에서는 300 ms마다 5초 동안 proximity·lux를 출력하고, trigger phase에서는 proximity가 threshold 조건을 만족해 interrupt가 발생할 때 값을 출력합니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.