Commit 4e686063 authored by koalo's avatar koalo
Browse files

doc(bhi160): Add BHI160 documentation

parent 51c6d605
...@@ -22,6 +22,7 @@ Last but not least, if you want to start hacking the lower-level firmware, the ...@@ -22,6 +22,7 @@ Last but not least, if you want to start hacking the lower-level firmware, the
pycardium/overview pycardium/overview
pycardium/stdlib pycardium/stdlib
pycardium/bhi160
pycardium/bme680 pycardium/bme680
pycardium/buttons pycardium/buttons
pycardium/color pycardium/color
...@@ -32,10 +33,10 @@ Last but not least, if you want to start hacking the lower-level firmware, the ...@@ -32,10 +33,10 @@ Last but not least, if you want to start hacking the lower-level firmware, the
pycardium/os pycardium/os
pycardium/personal_state pycardium/personal_state
pycardium/power pycardium/power
pycardium/pride
pycardium/simple_menu pycardium/simple_menu
pycardium/utime pycardium/utime
pycardium/vibra pycardium/vibra
pycardium/pride
.. toctree:: .. toctree::
:maxdepth: 1 :maxdepth: 1
......
.. py:module:: bhi160
``bhi160`` - Sensor Fusion
==========================
.. versionadded:: 1.4
Supports the BHI160 sensor on the card10 for accelerometer, gyroscope...
**Example**:
.. code-block:: python
import bhi160
import utime
bhi = bhi160.BHI160Orientation()
while True:
samples = bhi.read()
print(samples)
utime.sleep(0.5)
.. class:: bhi160.BHI160Orientation(sample_rate,dynamic_range,callback,sample_buffer_len)
Orientation of the BHI160
Parameters:
sample_rate: int, optional
Sample rate (default is 4)
dynamic_range: int, optional
Dynamic range (default is 2)
callback: callable, optional
Call this callback when enough data is collected (default is None)
.. todo:: The callback functionality is untested, so do not be confused if it does not work.
sample_buffer_len: int, optional
Length of sample buffer (default is 200)
.. py:method:: read():
Read sensor values
:returns: Collected sensor values as list
.. py:method:: close():
Close the connection to the sensor
.. class:: bhi160.BHI160Accelerometer
Accelerometer of the BHI160
Parameters:
sample_rate: int, optional
Sample rate (default is 4)
dynamic_range: int, optional
Dynamic range (default is 2)
callback: callable, optional
Call this callback when enough data is collected (default is None)
.. todo:: The callback functionality is untested, so do not be confused if it does not work.
sample_buffer_len: int, optional
Length of sample buffer (default is 200)
.. py:method:: read():
Read sensor values
:returns: Collected sensor values as list
.. py:method:: close():
Close the connection to the sensor
.. class:: bhi160.BHI160Gyroscope
Gyroscope of the BHI160
Parameters:
sample_rate: int, optional
Sample rate (default is 4)
dynamic_range: int, optional
Dynamic range (default is 2)
callback: callable, optional
Call this callback when enough data is collected (default is None)
.. todo:: The callback functionality is untested, so do not be confused if it does not work.
sample_buffer_len: int, optional
Length of sample buffer (default is 200)
.. py:method:: read():
Read sensor values
:returns: Collected sensor values as list
.. py:method:: close():
Close the connection to the sensor
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment