1.. zephyr:code-sample:: lsmd6dso
2   :name: LSM6DSO IMU sensor
3   :relevant-api: sensor_interface
4
5   Get accelerometer and gyroscope data from an LSM6DSO sensor (polling & trigger
6   mode).
7
8Overview
9********
10This sample sets the data rate of the LSM6DSO accelerometer and gyroscope to
1112.5Hz and enables a trigger on data ready. It displays on the console
12the values for accelerometer and gyroscope.
13
14Requirements
15************
16
17This sample uses the LSM6DSO sensor controlled using the I2C interface.
18It has been tested on the :zephyr:board:`stm32l562e_dk`.
19
20References
21**********
22
23- LSM6DSO https://www.st.com/en/mems-and-sensors/lsm6dso.html
24
25Building and Running
26********************
27
28 This project outputs sensor data to the console. It requires an LSM6DSO
29 sensor, which is present on the :zephyr:board:`stm32l562e_dk`.
30
31Building on stm32l562e_dk board
32===============================
33
34.. zephyr-app-commands::
35   :zephyr-app: samples/sensor/lsm6dso
36   :host-os: unix
37   :board: stm32l562e_dk
38   :goals: build
39   :compact:
40
41Sample Output
42=============
43
44.. code-block:: console
45
46    Testing LSM6DSO sensor in trigger mode.
47
48    accel x:-0.650847 ms/2 y:-5.300102 ms/2 z:-8.163114 ms/2
49    gyro x:-0.167835 dps y:-0.063377 dps z:0.002367 dps
50    trig_cnt:1
51
52    accel x:0.341575 ms/2 y:5.209773 ms/2 z:-7.938787 ms/2
53    gyro x:-0.034284 dps y:-0.004428 dps z:-0.003512 dps
54    trig_cnt:2
55
56    <repeats endlessly>
57