Part 1
요약·해설
Default LSM303AGR와 optional LPS22HB 경로, Mode 2·multiple-instance 제한을 설명합니다.
LSM6DSL
LSM303AGR
LPS22HB
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
02BCA6C3AB36D23904817D52B92B129831EF87C0676C34D9676ED797CB9A71E5
.. zephyr:code-sample:: x-nucleo-iks01a2-shub
:name: X-NUCLEO-IKS01A2 shield - SensorHub (Mode 2)
:relevant-api: sensor_interface
Interact with all the sensors of an X-NUCLEO-IKS01A2 shield using Sensor Hub mode.
Overview
********
This sample is provided as an example to test the X-NUCLEO-IKS01A2 shield
configured in Sensor Hub mode (Mode 2).
Please refer to :ref:`x-nucleo-iks01a2` for more info on this configuration.
This sample enables LSM6DSL sensors. Since all other shield
devices are connected to LSM6DSL, the LSM6DSL driver is configured in sensorhub
mode (CONFIG_LSM6DSL_SENSORHUB=y) with a selection of one slave only
among LPS22HB and LSM303AGR (default is LSM303AGR)
Then sensor data are displayed periodically
- LSM6DSL 6-Axis acceleration and angular velocity
- LSM6DSL 3-Axis magnetic field intensity (from LSM303AGR mag) - Primary option
- LSM6DSL ambient temperature and atmospheric pressure (from LPS22HB) -
Secondary option
Requirements
************
This sample communicates over I2C with the X-NUCLEO-IKS01A2 shield
stacked on a board with an Arduino connector. The shield must be configured in
Mode 2.
Please note that this sample can't be used with boards already supporting
one of the sensors available on the shield (such as disco_l475_iot1) as zephyr
does not yet support sensors multiple instances.
References
**********
-X-NUCLEO-IKS01A2: https://www.st.com/en/ecosystems/x-nucleo-iks01a2.html
Building and Running
********************
This sample runs with X-NUCLEO-IKS01A2 stacked on any board with a matching
Arduino connector. For this example, we use a :ref:`nucleo_f401re_board` board.
.. zephyr-app-commands::
:zephyr-app: samples/shields/x_nucleo_iks01a2/sensorhub
:board: nucleo_f401re
:goals: build
:compact:
Sample Output
=============
.. code-block:: console
X-NUCLEO-IKS01A2 sensor dashboard
LSM6DSL: Accel (m.s-2): x: 0.0, y: 0.2, z: 10.0
LSM6DSL: Gyro (dps): x: 0.029, y: -0.030, z: 0.016
LSM6DSL: Magn (gauss): x: 0.363, y: -0.002, z: -0.559
9:: lsm6dsl acc trig 1668
<updated endlessly every 2 seconds>
Part 3
한국어 전문 번역
개요
X-NUCLEO-IKS01A2 shield를 Sensor Hub mode(Mode 2)로 구성해 시험하는 sample입니다. Mode 2의 hardware configuration은 X-NUCLEO-IKS01A2 shield 문서를 참조합니다.
Sample은 LSM6DSL sensor를 활성화합니다. Shield의 다른 device가 모두 LSM6DSL에 연결되어 있으므로 LSM6DSL driver를 CONFIG_LSM6DSL_SENSORHUB=y로 구성하고, LPS22HB와 LSM303AGR 중 slave 하나만 선택합니다. Default slave는 LSM303AGR입니다.
그 뒤 sensor data를 주기적으로 표시합니다.
- LSM6DSL 자체의 6-axis acceleration과 angular velocity
- Primary option: LSM303AGR magnetometer에서 온 3-axis magnetic field intensity를 LSM6DSL 경유로 읽음
- Secondary option: LPS22HB에서 온 ambient temperature와 atmospheric pressure를 LSM6DSL 경유로 읽음
요구 사항
Arduino connector가 있는 board에 X-NUCLEO-IKS01A2 shield를 쌓고 I2C로 통신합니다. Shield 자체는 반드시 Mode 2로 구성해야 합니다.
Zephyr 3.7.0은 sensor multiple instance를 아직 지원하지 않으므로 disco_l475_iot1처럼 shield sensor 중 하나를 이미 지원하는 board에서는 사용할 수 없습니다.
참고 자료
빌드 및 실행
Matching Arduino connector가 있는 board에서 실행할 수 있으며, 예제 target은 nucleo_f401re입니다.
west build -b nucleo_f401re samples/shields/x_nucleo_iks01a2/sensorhub
출력 예
X-NUCLEO-IKS01A2 sensor dashboard
LSM6DSL: Accel (m.s-2): x: 0.0, y: 0.2, z: 10.0
LSM6DSL: Gyro (dps): x: 0.029, y: -0.030, z: 0.016
LSM6DSL: Magn (gauss): x: 0.363, y: -0.002, z: -0.559
9:: lsm6dsl acc trig 1668
<updated endlessly every 2 seconds>
Default LSM303AGR slave를 사용하므로 acceleration·gyroscope와 함께 magnetic field가 표시됩니다. Trigger count line을 포함해 dashboard는 2초마다 계속 갱신됩니다. Secondary LPS22HB option을 선택하면 magnetic field 대신 temperature와 pressure 경로를 사용합니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.