1.. zephyr:code-sample:: sensortile_box_pro_sensors 2 :name: SensorTile.box Pro sensors 3 4 Read sensor data from the various SensorTile.box Pro sensors. 5 6Overview 7******** 8This sample provides an example of how to read sensors data 9from the SensorTile.box Pro board. 10 11This sample enables all sensors of SensorTile.box Pro board, and then 12periodically reads and displays data on the console from the following 13sensors: 14 15- LPS22DF: ambient temperature and atmospheric pressure 16- LSM6DSV16X: 6-Axis acceleration and angular velocity 17- LIS2DU12: 3-Axis acceleration 18 19Requirements 20************ 21 22The application requires a SensorTile.box Pro board connected to the PC 23through USB. The board shows up as a USB CDC class standard device. 24 25References 26********** 27 28- :zephyr:board:`sensortile_box_pro` 29 30Building and Running 31******************** 32 33Build and flash the sample in the following way: 34 35.. zephyr-app-commands:: 36 :zephyr-app: samples/boards/st/sensortile_box_pro/sensors-on-board 37 :board: sensortile_box_pro 38 :goals: build flash 39 40Please note that flashing the board requires a few preliminary steps described 41in :zephyr:board:`sensortile_box_pro`. 42 43Then, power cycle the board by disconnecting and reconnecting the USB cable. 44Run your favorite terminal program to listen for output. 45 46.. code-block:: console 47 48 $ minicom -D <tty_device> -b 115200 49 50Replace :code:`<tty_device>` with the correct device path automatically created on 51the host after the SensorTile.box Pro board gets connected to it, 52usually :code:`/dev/ttyUSBx` or :code:`/dev/ttyACMx` (with x being 0, 1, 2, ...). 53The ``-b`` option sets baud rate ignoring the value from config. 54 55Sample Output 56============= 57 58The sample code outputs sensors data on the SensorTile.box Pro console. 59 60 .. code-block:: console 61 62 SensorTile.box Pro dashboard 63 64 LPS22DF: Temperature: 28.4 C 65 LPS22DF: Pressure:99.694 kpa 66 LSM6DSV16X: Accel (m.s-2): x: -0.158, y: 0.158, z: 9.811 67 LSM6DSV16X: GYro (dps): x: 0.003, y: 0.000, z: -0.005 68 LIS2DU12: Accel (m.s-2): x: -0.756, y: -0.249, z: -9.629 69 1:: lps22df trig 199 70 1:: lsm6dsv16x acc trig 836 71 1:: lsm6dsv16x gyr trig 836 72 1:: lis2mdl trig 402 73 1:: lis2du12 trig 1589 74 75 <repeats endlessly every 2s> 76