1.. zephyr:code-sample:: x-nucleo-iks01a2-shub 2 :name: X-NUCLEO-IKS01A2 shield - SensorHub (Mode 2) 3 :relevant-api: sensor_interface 4 5 Interact with all the sensors of an X-NUCLEO-IKS01A2 shield using Sensor Hub mode. 6 7Overview 8******** 9This sample is provided as an example to test the X-NUCLEO-IKS01A2 shield 10configured in Sensor Hub mode (Mode 2). 11Please refer to :ref:`x-nucleo-iks01a2` for more info on this configuration. 12 13This sample enables LSM6DSL sensors. Since all other shield 14devices are connected to LSM6DSL, the LSM6DSL driver is configured in sensorhub 15mode (CONFIG_LSM6DSL_SENSORHUB=y) with a selection of one slave only 16among LPS22HB and LSM303AGR (default is LSM303AGR) 17 18Then sensor data are displayed periodically 19 20- LSM6DSL 6-Axis acceleration and angular velocity 21- LSM6DSL 3-Axis magnetic field intensity (from LSM303AGR mag) - Primary option 22- LSM6DSL ambient temperature and atmospheric pressure (from LPS22HB) - 23 Secondary option 24 25Requirements 26************ 27 28This sample communicates over I2C with the X-NUCLEO-IKS01A2 shield 29stacked on a board with an Arduino connector. The shield must be configured in 30Mode 2. 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) as zephyr 34does not yet support sensors multiple instances. 35 36References 37********** 38 39-X-NUCLEO-IKS01A2: https://www.st.com/en/ecosystems/x-nucleo-iks01a2.html 40 41Building and Running 42******************** 43 44This sample runs with X-NUCLEO-IKS01A2 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_iks01a2/sensorhub 49 :board: nucleo_f401re 50 :goals: build 51 :compact: 52 53Sample Output 54============= 55 56 .. code-block:: console 57 58 X-NUCLEO-IKS01A2 sensor dashboard 59 60 LSM6DSL: Accel (m.s-2): x: 0.0, y: 0.2, z: 10.0 61 LSM6DSL: Gyro (dps): x: 0.029, y: -0.030, z: 0.016 62 LSM6DSL: Magn (gauss): x: 0.363, y: -0.002, z: -0.559 63 9:: lsm6dsl acc trig 1668 64 65 <updated endlessly every 2 seconds> 66