|
| 1 | +.. _sensortile_box sensors: |
| 2 | + |
| 3 | +ST SensorTile.box |
| 4 | +################# |
| 5 | + |
| 6 | +Overview |
| 7 | +******** |
| 8 | +This sample provides an example of how to read sensors data |
| 9 | +from the SensorTile.box board. |
| 10 | + |
| 11 | +This sample enables all sensors of SensorTile.box board, and then |
| 12 | +periodically reads and displays data on the console from the following |
| 13 | +sensors: |
| 14 | + |
| 15 | +- HTS221: ambient temperature and relative humidity |
| 16 | +- LPS22HH: ambient temperature and atmospheric pressure |
| 17 | +- LIS2DW12: 3-Axis acceleration |
| 18 | +- LSM6DSOX: 6-Axis acceleration and angular velocity |
| 19 | +- STTS751: temperature sensor |
| 20 | + |
| 21 | +Requirements |
| 22 | +************ |
| 23 | + |
| 24 | +The application requires a SensorTile.box board connected to the PC |
| 25 | +through USB. The board declares itself as a USB CDC class device. |
| 26 | + |
| 27 | +References |
| 28 | +********** |
| 29 | + |
| 30 | +- :ref:`sensortile_box` |
| 31 | + |
| 32 | +Building and Running |
| 33 | +******************** |
| 34 | + |
| 35 | +Build and flash the sample in the following way: |
| 36 | + |
| 37 | +.. zephyr-app-commands:: |
| 38 | + :zephyr-app: samples/boards/sensortile_box |
| 39 | + :board: sensortile_box |
| 40 | + :goals: build flash |
| 41 | + |
| 42 | +Please note that flashing the board requires a few preliminary steps described |
| 43 | +in :ref:`sensortile_box`. |
| 44 | + |
| 45 | +Then, power cycle the board by disconnecting and reconnecting the USB cable. |
| 46 | +Run your favorite terminal program to listen for output. |
| 47 | + |
| 48 | +.. code-block:: console |
| 49 | +
|
| 50 | + $ minicom -D <tty_device> -b 115200 |
| 51 | +
|
| 52 | +Replace :code:`<tty_device>` with the port where the SensorTile.box board |
| 53 | +can be found. For example, under Linux, :code:`/dev/ttyUSB0`. |
| 54 | +The ``-b`` option sets baud rate ignoring the value from config. |
| 55 | + |
| 56 | +Sample Output |
| 57 | +============= |
| 58 | + |
| 59 | +The sample code outputs sensors data on the SensorTile.box console. |
| 60 | + |
| 61 | + .. code-block:: console |
| 62 | +
|
| 63 | + SensorTile.box dashboard |
| 64 | +
|
| 65 | + HTS221: Temperature: 26.4 C |
| 66 | + HTS221: Relative Humidity: 60.5% |
| 67 | + LPS22HH: Temperature: 28.4 C |
| 68 | + LPS22HH: Pressure:99.694 kpa |
| 69 | + LIS2DW12: Accel (m.s-2): x: 0.306, y: -0.459, z: 10.031 |
| 70 | + LSM6DSOX: Accel (m.s-2): x: -0.158, y: 0.158, z: 9.811 |
| 71 | + LSM6DSOX: GYro (dps): x: 0.003, y: 0.000, z: -0.005 |
| 72 | + STTS751: Temperature: 27.0 C |
| 73 | + 1:: lps22hh trig 206 |
| 74 | + 1:: lis2dw12 trig 410 |
| 75 | + 1:: lsm6dsox acc trig 836 |
| 76 | + 1:: lsm6dsox gyr trig 836 |
| 77 | +
|
| 78 | + <repeats endlessly every 2s> |
| 79 | +
|
| 80 | +If you move the board around or put your finger on the temperature |
| 81 | +sensor, you will see the accelerometer, gyro, and temperature values change. |
0 commit comments