bhi160.rst 1.06 KB
Newer Older
koalo's avatar
koalo committed
1
2
3
4
.. py:module:: bhi160

``bhi160`` - Sensor Fusion
==========================
5

koalo's avatar
koalo committed
6
7
.. versionadded:: 1.4

8
9
10
11
12
13
14
15
16
Supports the BHI160 sensor on the card10 for accelerometer, gyroscope,
magnetometer and orientation.

The coordinate system of the BHI160 sensor data looks like this:

.. image:: ../static/bhi160-coordinates.png

All angles and angular velocities (like gyroscope, orientation) rotate counter
clockwise around their respective axis.
koalo's avatar
koalo committed
17
18
19
20
21
22
23

**Example**:

.. code-block:: python

   import bhi160
   import utime
Rahix's avatar
Rahix committed
24

koalo's avatar
koalo committed
25
26
27
28
   bhi = bhi160.BHI160Orientation()

    while True:
        samples = bhi.read()
29
30
31
32
33
34
        if len(samples) == 0:
            utime.sleep(0.25)
            continue
        # print the latest sample
        print(samples[-1])
        utime.sleep(0.25)
Rahix's avatar
Rahix committed
35

36

37
.. autoclass:: bhi160.BHI160
38

39
40
41
.. autoclass:: bhi160.BHI160Orientation
   :members:
   :inherited-members:
42

43
44
45
.. autoclass:: bhi160.BHI160Accelerometer
  :members:
  :inherited-members:
46

47
48
49
.. autoclass:: bhi160.BHI160Gyroscope
  :members:
  :inherited-members:
50

51
52
53
.. autoclass:: bhi160.BHI160Magnetometer
  :members:
  :inherited-members: