# adafruit/adafruit_circuitpython_bno055 architecture

> Architecture diagram of the GitHub repository adafruit/adafruit_circuitpython_bno055, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-02-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adafruit/adafruit_circuitpython_bno055
- Repository: https://github.com/adafruit/adafruit_circuitpython_bno055

## Overview

##### Project type and purpose
- This is an open-source CircuitPython driver library for the Bosch BNO055 IMU sensor.
- It provides a Python API to configure the sensor, read orientation, temperature, gravity, etc., on boards running CircuitPython or CPython on Linux (e.g., Raspberry Pi).
- The project also contains examples (CLI scripts and a WebGL demo) and supporting documentation, CI configuration, and packaging workflows.

##### File structure
Top-level:
- adafruit_bno055.py – main driver module implementing the BNO055 API
- optional_requirements.txt, requirements.txt, pyproject.toml – dependency declarations for PyPI packaging
- .github/workflows – CI/CD pipelines for building, testing, releasing to GitHub and PyPI
- docs/ – Sphinx documentation source (conf.py, .rst files)
- examples/ – application code that consumes the driver
– simple Python scripts (calibrator, compass mode, simpletest)

##### README for additional insights
- Dependencies: Adafruit_CircuitPython_Register, Adafruit_CircuitPython_BusDevice
- Usage: instantiate I2C bus via board.I2C(), then create BNO055_I2C object, then read properties
- Documentation hosted on ReadTheDocs
- Packaging on PyPI, build via GitHub Actions

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Hardware Layer"
        Sensor["BNO055 Sensor"]:::hardware
        I2C["I2C Bus"]:::hardware
    end

    subgraph "Driver Layer"
        Driver["BNO055_I2C Driver\n(adafruit_bno055.py)"]:::library
        BusDeviceDep["BusDevice Library"]:::library
        RegisterDep["Register Library"]:::library
    end

    subgraph "Examples"
        CLI_Cal["Calibrator CLI\n(bno055_calibrator.py)"]:::example
        CLI_Comp["Compass Mode CLI\n(bno055_compass_mode.py)"]:::example
        CLI_GPIO["I2C GPIO Simpletest\n(bno055_i2c-gpio_simpletest.py)"]:::example
        CLI_Simple["Simpletest CLI\n(bno055_simpletest.py)"]:::example
        subgraph "WebGL Demo"
            DemoServer["WebGL Server\n(server.py)"]:::example
            DemoClient["WebGL Client\n(static assets)"]:::example
            HTMLTemplate["HTML Template\n(index.html)"]:::example
        end
    end

    subgraph "Infrastructure & Tooling"
        subgraph "CI/CD Pipelines"
            Build["Build & Test"]:::infra
            Fail["Failure Help"]:::infra
            GHRel["GitHub Release"]:::infra
            PyRel["PyPI Release"]:::infra
        end
        subgraph "Documentation"
            Conf["Sphinx Config\n(conf.py)"]:::infra
            APIRef["API Reference\n(api.rst)"]:::infra
            ExDocs["Examples Docs\n(examples.rst)"]:::infra
            IndexDoc["Overview\n(index.rst)"]:::infra
        end
        subgraph "Packaging"
            PyProj["pyproject.toml"]:::infra
            Req["requirements.txt"]:::infra
            OptReq["optional_requirements.txt"]:::infra
        end
    end

    %% Relationships
    Driver -->|uses| BusDeviceDep
    Driver -->|uses| RegisterDep
    Driver -->|communicates over| I2C
    I2C -->|connects to| Sensor

    CLI_Cal -->|imports| Driver
    CLI_Comp -->|imports| Driver
    CLI_GPIO -->|imports| Driver
    CLI_Simple -->|imports| Driver

    DemoServer -->|imports| Driver
    DemoServer -->|serves data to| DemoClient
    DemoServer -->|serves HTML template| HTMLTemplate

    Build -->|runs tests and builds docs| Conf
    Build -->|publishes package| PyProj
    Build -->|publishes package| Req
    Build -->|publishes package| OptReq
    Build -->|deploys docs| APIRef
    Build -->|deploys docs| ExDocs
    Build -->|deploys docs| IndexDoc

    Fail -->|provides CI help| Build
    GHRel -->|creates GitHub release| PyRel
    PyRel -->|publishes to PyPI| PyProj

    %% Click Events
    click Driver "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/adafruit_bno055.py"
    click BusDeviceDep "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/optional_requirements.txt"
    click RegisterDep "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/optional_requirements.txt"
    click PyProj "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/pyproject.toml"
    click Req "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/requirements.txt"
    click OptReq "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/optional_requirements.txt"
    click Build "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/.github/workflows/build.yml"
    click Fail "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/.github/workflows/failure-help-text.yml"
    click GHRel "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/.github/workflows/release_gh.yml"
    click PyRel "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/.github/workflows/release_pypi.yml"
    click Conf "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/docs/conf.py"
    click APIRef "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/docs/api.rst"
    click ExDocs "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/docs/examples.rst"
    click IndexDoc "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/docs/index.rst"
    click CLI_Cal "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/examples/bno055_calibrator.py"
    click CLI_Comp "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/examples/bno055_compass_mode.py"
    click CLI_GPIO "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/examples/bno055_i2c-gpio_simpletest.py"
    click CLI_Simple "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/examples/bno055_simpletest.py"
    click DemoServer "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/examples/bno055_webgl_demo/server.py"
    click DemoClient "https://github.com/adafruit/adafruit_circuitpython_bno055/tree/main/examples/bno055_webgl_demo/static/"
    click HTMLTemplate "https://github.com/adafruit/adafruit_circuitpython_bno055/blob/main/examples/bno055_webgl_demo/templates/index.html"

    %% Styles
    classDef hardware fill:#b7e4c7,stroke:#2d6a4f,color:#1b4332;
    classDef library fill:#ade8f4,stroke:#1b262c,color:#1b262c;
    classDef example fill:#ffc8dd,stroke:#ff006e,color:#6a040f;
    classDef infra fill:#e9ecef,stroke:#495057,color:#212529;
```
