• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

src/11-Mar-2024-121100

CMakeLists.txtD11-Mar-2024266 1310

README.rstD11-Mar-20241.9 KiB7654

prj.confD11-Mar-202482 54

sample.yamlD11-Mar-2024180 1211

README.rst

1.. _lis2dh:
2
3LIS2DH: Motion Sensor Monitor
4#############################
5
6Overview
7********
8
9This sample application periodically reads accelerometer data from the
10LIS2DH sensor (or the compatible LS2DH12, LIS3DH, and LSM303DLHC
11sensors), and displays the sensor data on the console.
12
13Requirements
14************
15
16This sample uses the LIS2DH, ST MEMS system-in-package featuring a 3D
17digital output motion sensor.
18
19References
20**********
21
22For more information about the LIS2DH motion sensor see
23https://www.st.com/en/mems-and-sensors/lis2dh.html.
24
25Building and Running
26********************
27
28The LIS2DH2 or compatible sensors are available on a variety of boards
29and shields supported by Zephyr, including:
30
31* :ref:`actinius_icarus`
32* :ref:`thingy52_nrf52832`
33* :ref:`stm32f3_disco_board`
34* :ref:`x-nucleo-iks01a2`
35
36See the board documentation for detailed instructions on how to flash
37and get access to the console where acceleration data is displayed.
38
39Building on actinius_icarus
40===========================
41
42:ref:`actinius_icarus` includes an ST LIS2DH12 accelerometer which
43supports the LIS2DH interface.
44
45.. zephyr-app-commands::
46   :zephyr-app: samples/sensor/lis2dh
47   :board: actinius_icarus
48   :goals: build flash
49   :compact:
50
51Building on nucleo_l476rg with IKS01A2 shield
52=============================================
53
54The :ref:`x-nucleo-iks01a2` includes an LSM303AGR accelerometer which
55supports the LIS2DH interface.  This shield may also be used on other
56boards with Arduino headers.
57
58.. zephyr-app-commands::
59   :zephyr-app: samples/sensor/lis2dh
60   :board: nucleo_l476rg
61   :goals: build flash
62   :shield: x_nucleo_iks01a2
63   :compact:
64
65Sample Output
66=============
67
68.. code-block:: console
69
70    Polling at 0.5 Hz
71    #1 @ 12 ms: x -5.387328 , y 5.578368 , z -5.463744
72    #2 @ 2017 ms: x -5.310912 , y 5.654784 , z -5.501952
73    #3 @ 4022 ms: x -5.349120 , y 5.692992 , z -5.463744
74
75   <repeats endlessly every 2 seconds>
76