Part 1
요약·해설
accel0 alias, BMI160 emulation overlay, 50Hz·50point 기본값과 20Hz build를 보존합니다.
X · Y · Z
50 Hz · 50 points
accel0
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
A508F82D04E22515CCFC822DD6A160A774990D1F10C60EACB089F43513A100A7
.. zephyr:code-sample:: lvgl-accelerometer-chart
:name: LVGL line chart with accelerometer data
:relevant-api: display_interface sensor_interface
Display acceleration data on a real-time chart using LVGL.
Overview
********
A sample application that demonstrates how to use LVGL and the :ref:`sensor` to
display acceleration data on a line chart that is updated in real time.
This sample creates a line chart with three series, one for each axis of the accelerometer. An LVGL
timer fetches the latest acceleration data from the sensor every 20 ms (default value) and updates
the chart. The update period is configurable, see
:ref:`lvgl_accelerometer_chart_building_and_running` below.
Requirements
************
* A board with a display.
* A sensor that provides acceleration data (:c:enumerator:`SENSOR_CHAN_ACCEL_XYZ`) and available
under the ``&accel0`` Devicetree alias.
.. note::
A Devicetree overlay declaring an emulated BMI160 accelerometer is provided for the
``native_posix*`` and ``native_sim*`` board variants, making it possible to run this sample on
your local machine.
.. _lvgl_accelerometer_chart_building_and_running:
Building and Running
********************
The maximum number of points to display for each series and the sampling rate of the
accelerometer can be configured using the :kconfig:option:`CONFIG_SAMPLE_CHART_POINTS_PER_SERIES`
and :kconfig:option:`CONFIG_SAMPLE_ACCEL_SAMPLING_RATE` Kconfig options, respectively.
The default sampling rate is 50 Hz, and the default maximum number of points per series is 50.
The demo can be built as follows (note how in this particular case the sampling rate is set to a
custom value of 20 Hz):
.. zephyr-app-commands::
:zephyr-app: samples/modules/lvgl/accelerometer_chart
:host-os: unix
:board: native_sim
:gen-args: -DCONFIG_SAMPLE_ACCEL_SAMPLING_RATE=20
:goals: run
:compact:
Part 3
한국어 전문 번역
개요
이 sample application은 LVGL과 sensor를 사용해 acceleration data를 실시간으로 갱신되는 line chart에 표시하는 방법을 보여줍니다.
Chart에는 accelerometer의 x, y, z axis마다 하나씩 모두 세 series가 있습니다. LVGL timer가 기본값으로 20ms마다 sensor에서 최신 acceleration data를 가져와 chart를 갱신합니다. Update period는 아래 Build와 실행 절에 설명한 대로 설정할 수 있습니다.
요구 사항
- Display가 있는 board
SENSOR_CHAN_ACCEL_XYZacceleration data를 제공하고&accel0Devicetree alias로 접근할 수 있는 sensor
native_posix*와 native_sim* board variant에는 emulated BMI160 accelerometer를 선언하는 Devicetree overlay가 제공되므로 local machine에서도 이 sample을 실행할 수 있습니다.
Build와 실행
Series마다 표시할 최대 point 수는 CONFIG_SAMPLE_CHART_POINTS_PER_SERIES로, accelerometer sampling rate는 CONFIG_SAMPLE_ACCEL_SAMPLING_RATE Kconfig option으로 설정합니다.
기본 sampling rate는 50Hz이고 series마다 표시할 기본 최대 point 수는 50개입니다. 다음 예제는 sampling rate를 사용자 지정 값인 20Hz로 설정합니다.
west build -b native_sim samples/modules/lvgl/accelerometer_chart -- -DCONFIG_SAMPLE_ACCEL_SAMPLING_RATE=20
west build -t run
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.