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

..--

src/11-Mar-2024-270204

CMakeLists.txtD11-Mar-2024385 1511

README.rstD11-Mar-20242.2 KiB7152

prj.confD11-Mar-2024231 109

sample.yamlD11-Mar-2024371 1918

README.rst

1.. zephyr:code-sample:: x-nucleo-iks02a1-std
2   :name: X-NUCLEO-IKS02A1 shield - Standard (Mode 1)
3   :relevant-api: sensor_interface
4
5   Interact with all the sensors of an X-NUCLEO-IKS02A1 shield using Standard mode.
6
7Overview
8********
9This sample is provided as an example to test the X-NUCLEO-IKS02A1 shield
10configured in Standard mode (Mode 1).
11Please refer to :ref:`x-nucleo-iks02a1` for more info on this configuration.
12
13This sample enables all sensors of a X-NUCLEO-IKS02A1 shield, and then
14periodically reads and displays data from the shield sensors:
15
16- IIS2MDC 3-Axis magnetic field intensity
17- IIS2DLPC 3-Axis acceleration
18- ISM330DHCX 6-Axis acceleration and angular velocity
19
20Requirements
21************
22
23This sample communicates over I2C with the X-NUCLEO-IKS02A1 shield
24stacked on a board with an Arduino connector. The board's I2C must be
25configured for the I2C Arduino connector (both for pin muxing
26and devicetree). See for example the :ref:`nucleo_f401re_board` board
27source code:
28
29- :file:`$ZEPHYR_BASE/boards/arm/nucleo_f401re/nucleo_f401re.dts`
30- :file:`$ZEPHYR_BASE/boards/arm/nucleo_f401re/pinmux.c`
31
32Please note that this sample can't be used with boards already supporting
33one of the sensors available on the shield (such as disco_l475_iot1)
34as sensors multiple instances are not supported.
35
36References
37**********
38
39- X-NUCLEO-IKS02A1: https://www.st.com/en/ecosystems/x-nucleo-iks02a1.html
40
41Building and Running
42********************
43
44This sample runs with X-NUCLEO-IKS02A1 stacked on any board with a matching
45Arduino connector. For this example, we use a :ref:`nucleo_f401re_board` board.
46
47.. zephyr-app-commands::
48   :zephyr-app: samples/shields/x_nucleo_iks02a1/standard/
49   :host-os: unix
50   :board: nucleo_f401re
51   :goals: build
52   :compact:
53
54Sample Output
55=============
56
57 .. code-block:: console
58
59    X-NUCLEO-IKS02A1 sensor Mode 1 dashboard
60
61    IIS2DLPC: Accel (m.s-2): x: 0.000, y: 0.000, z: 9.342
62    IIS2MDC: Magn (gauss): x: -0.120, y: -0.095, z: -0.338
63    IIS2MDC: Temperature: 25.1 C
64    ISM330DHCX: Accel (m.s-2): x: 0.182, y: -0.306, z: 9.753
65    ISM330DHCX: GYro (dps): x: 0.005, y: 0.001, z: -0.004
66    5:: iis2dlpc trig 809
67    5:: ism330dhcx acc trig 3332
68    5:: ism330dhcx gyr trig 1666
69
70    <updated endlessly every 2 seconds>
71