bhi160.rst 859 Bytes
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
Supports the BHI160 sensor on the card10 for accelerometer, gyroscope, magnetometer and orientation.
koalo's avatar
koalo committed
9
10
11
12
13
14
15

**Example**:

.. code-block:: python

   import bhi160
   import utime
Rahix's avatar
Rahix committed
16

koalo's avatar
koalo committed
17
18
19
20
   bhi = bhi160.BHI160Orientation()

    while True:
        samples = bhi.read()
21
22
23
24
25
26
        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
27

28

29
.. autoclass:: bhi160.BHI160
30

31
32
33
.. autoclass:: bhi160.BHI160Orientation
   :members:
   :inherited-members:
34

35
36
37
.. autoclass:: bhi160.BHI160Accelerometer
  :members:
  :inherited-members:
38

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

43
44
45
.. autoclass:: bhi160.BHI160Magnetometer
  :members:
  :inherited-members: