/ README.rst
README.rst
  1  Introduction
  2  ============
  3  
  4  .. image:: https://readthedocs.org/projects/adafruit-circuitpython-bno055/badge/?version=latest
  5      :target: https://circuitpython.readthedocs.io/projects/bno055/en/latest/
  6      :alt: Documentation Status
  7  
  8  .. image :: https://img.shields.io/discord/327254708534116352.svg
  9      :target: https://adafru.it/discord
 10      :alt: Discord
 11  
 12  .. image:: https://github.com/adafruit/Adafruit_CircuitPython_BNO055/workflows/Build%20CI/badge.svg
 13      :target: https://github.com/adafruit/Adafruit_CircuitPython_BNO055/actions/
 14      :alt: Build Status
 15  
 16  
 17  Dependencies
 18  =============
 19  
 20  This driver depends on the `Register
 21  <https://github.com/adafruit/Adafruit_CircuitPython_Register>`_ and `Bus Device
 22  <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_ libraries.
 23  Please ensure they are also available on the CircuitPython filesystem.  This is
 24  easily achieved by downloading `a library and driver bundle
 25  <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.
 26  
 27  Installing from PyPI
 28  ====================
 29  
 30  On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
 31  PyPI <https://pypi.org/project/adafruit-circuitpython-bno055/>`_. To install for current user:
 32  
 33  .. code-block:: shell
 34  
 35      pip3 install adafruit-circuitpython-bno055
 36  
 37  To install system-wide (this may be required in some cases):
 38  
 39  .. code-block:: shell
 40  
 41      sudo pip3 install adafruit-circuitpython-bno055
 42  
 43  To install in a virtual environment in your current project:
 44  
 45  .. code-block:: shell
 46  
 47      mkdir project-name && cd project-name
 48      python3 -m venv .env
 49      source .env/bin/activate
 50      pip3 install adafruit-circuitpython-bno055
 51  
 52  Usage Notes
 53  ===========
 54  
 55  Of course, you must import the library to use it:
 56  
 57  .. code:: python
 58  
 59      import adafruit_bno055
 60  
 61  
 62  This driver takes an instantiated and active I2C object (from the `busio` or
 63  the `bitbangio` library) as an argument to its constructor.  The way to create
 64  an I2C object depends on the board you are using. For boards with labeled SCL
 65  and SDA pins, you can:
 66  
 67  .. code:: python
 68  
 69      from busio import I2C
 70      from board import SDA, SCL
 71  
 72      i2c = I2C(SCL, SDA)
 73  
 74  Once you have the I2C object, you can create the sensor object:
 75  
 76  .. code:: python
 77  
 78      sensor = adafruit_bno055.BNO055(i2c)
 79  
 80  
 81  And then you can start reading the measurements:
 82  
 83  .. code:: python
 84  
 85      print(sensor.temperature)
 86      print(sensor.euler)
 87      print(sensor.gravity)
 88  
 89  
 90  Contributing
 91  ============
 92  
 93  Contributions are welcome! Please read our `Code of Conduct
 94  <https://github.com/adafruit/Adafruit_CircuitPython_bno055/blob/master/CODE_OF_CONDUCT.md>`_
 95  before contributing to help this project stay welcoming.
 96  
 97  
 98  Documentation
 99  =============
100  
101  For information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.