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

..--

boards/18-Mar-2025-1412

src/18-Mar-2025-208146

CMakeLists.txtD18-Mar-2025223 96

README.rstD18-Mar-20252.1 KiB6247

prj.confD18-Mar-202588 65

sample.yamlD18-Mar-2025193 1110

README.rst

1.. zephyr:code-sample:: bmg160
2   :name: BMG160 3-axis gyroscope
3   :relevant-api: sensor_interface
4
5   Get temperature, and angular velocity data from a BMG160 sensor.
6
7Overview
8********
9
10This sample shows how to use the Zephyr :ref:`sensor` API driver for the
11`Bosch BMG160`_ environmental sensor.
12
13.. _Bosch BMG160:
14   https://web.archive.org/web/20181111220522/https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BMG160-DS000-09.pdf
15
16The sample first runs in polling mode for 15 seconds, then in trigger mode, display the temperature and angular velocity data from the BMG160 sensor.
17
18Building and Running
19********************
20
21The sample can be configured to support BMG160 sensors connected via I2C. Configuration is done via :ref:`devicetree <dt-guide>`. The devicetree
22must have an enabled node with ``compatible = "bosch,bmg160";``. See
23:dtcompatible:`bosch,bmg160` for the devicetree binding and see below for
24examples and common configurations.
25
26If the sensor is not built into your board, start by wiring the sensor pins
27according to the connection diagram given in the `BMG160 datasheet`_ at
28page 78.
29
30.. _BMG160 datasheet:
31   https://www.mouser.com/datasheet/2/783/BST-BMG160-DS000-1509613.pdf
32
33Sample Output
34=============
35
36The sample prints output to the serial console. BMG160 device driver messages
37are also logged. Refer to your board's documentation for information on
38connecting to its serial console.
39
40Here is example output for the default application settings, assuming that only
41one BMG160 sensor is connected to the standard Arduino I2C pins:
42
43.. code-block:: none
44
45   *** Booting Zephyr OS v3.7.0 ***
46   Testing the polling mode.
47   Gyro (rad/s): X=3.6, Y=14.0, Z=0.0f,
48   Temperature (Celsius): 29.4
49   Gyro (rad/s): X=5.1, Y=-9.0, Z=0.0f,
50   Temperature (Celsius): 29.5
51   ...
52   Polling mode test finished.
53   Testing the trigger mode.
54   Gyro: Testing anymotion trigger.
55   Gyro: rotate the device and wait for events.
56   Gyro (rad/s): X=13.6, Y=14.0, Z=10.0f,
57   Gyro: Anymotion trigger test finished.
58   Gyro: Testing data ready trigger.
59   Gyro (rad/s): X=3.6, Y=5.4, Z=1.1f,
60   Gyro: Data ready trigger test finished.
61   Trigger mode test finished
62