|
3 | 3 | # SPDX-License-Identifier: MIT |
4 | 4 |
|
5 | 5 | """ |
6 | | -``adafruit_bno055`` - Adafruit 9-DOF Absolute Orientation IMU Fusion Breakout - BNO055 |
| 6 | +`adafruit_bno055` |
7 | 7 | ======================================================================================= |
8 | 8 |
|
9 | 9 | This is a CircuitPython driver for the Bosch BNO055 nine degree of freedom |
10 | 10 | inertial measurement unit module with sensor fusion. |
11 | 11 |
|
12 | 12 | * Author(s): Radomir Dopieralski |
| 13 | +
|
| 14 | +
|
| 15 | +**Hardware:** |
| 16 | +
|
| 17 | +* Adafruit `9-DOF Absolute Orientation IMU Fusion Breakout - BNO055 |
| 18 | + <https://www.adafruit.com/product/4646>`_ (Product ID: 4646) |
| 19 | +
|
| 20 | +
|
| 21 | +**Software and Dependencies:** |
| 22 | +
|
| 23 | +* Adafruit CircuitPython firmware for the supported boards: |
| 24 | + https://circuitpython.org/downloads |
| 25 | +
|
| 26 | +* Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice |
| 27 | +
|
| 28 | +* Adafruit's Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register |
| 29 | +
|
13 | 30 | """ |
14 | 31 | import time |
15 | 32 | import struct |
@@ -164,6 +181,31 @@ def __set__(self, obj, value): |
164 | 181 | class BNO055: # pylint: disable=too-many-public-methods |
165 | 182 | """ |
166 | 183 | Base class for the BNO055 9DOF IMU sensor. |
| 184 | +
|
| 185 | + **Quickstart: Importing and using the device** |
| 186 | +
|
| 187 | + Here is an example of using the :class:`BNO055` class. |
| 188 | + First you will need to import the libraries to use the sensor |
| 189 | +
|
| 190 | + .. code-block:: python |
| 191 | +
|
| 192 | + import board |
| 193 | + import adafruit_bno055 |
| 194 | +
|
| 195 | + Once this is done you can define your `board.I2C` object and define your sensor object |
| 196 | +
|
| 197 | + .. code-block:: python |
| 198 | +
|
| 199 | + i2c = board.I2C() # uses board.SCL and board.SDA |
| 200 | + sensor = adafruit_bno055.BNO055_I2C(i2c) |
| 201 | +
|
| 202 | +
|
| 203 | + Now you have access to the :attr:`acceleration` attribute among others |
| 204 | +
|
| 205 | + .. code-block:: python |
| 206 | +
|
| 207 | + sensor = accelerometer.acceleration |
| 208 | +
|
167 | 209 | """ |
168 | 210 |
|
169 | 211 | def __init__(self): |
@@ -227,11 +269,11 @@ def mode(self): |
227 | 269 | | NDOF_MODE | X | X | X | X | - | |
228 | 270 | +------------------+-------+---------+------+----------+----------+ |
229 | 271 |
|
230 | | - The default mode is ``NDOF_MODE``. |
| 272 | + The default mode is :const:`NDOF_MODE`. |
231 | 273 |
|
232 | 274 | | You can set the mode using the line below: |
233 | 275 | | ``sensor.mode = adafruit_bno055.ACCONLY_MODE`` |
234 | | - | replacing ``ACCONLY_MODE`` with the mode you want to use |
| 276 | + | replacing :const:`ACCONLY_MODE` with the mode you want to use |
235 | 277 |
|
236 | 278 | .. data:: CONFIG_MODE |
237 | 279 |
|
@@ -662,7 +704,7 @@ def axis_remap(self): |
662 | 704 |
|
663 | 705 | @axis_remap.setter |
664 | 706 | def axis_remap(self, remap): |
665 | | - """Pass a tuple coinsidting of x, y, z, x_sign, y-sign, and z_sign. |
| 707 | + """Pass a tuple consisting of x, y, z, x_sign, y-sign, and z_sign. |
666 | 708 |
|
667 | 709 | Set axis remap for each axis. The x, y, z parameter values should |
668 | 710 | be set to one of AXIS_REMAP_X (0x00), AXIS_REMAP_Y (0x01), or |
|
0 commit comments