GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - robotcopper/BNO08x_Pico_Library: Raspberry Pi Pico RP2040 library pico-sdk compatible to use the BNO08x IMU

BranchesTags
Open more actions menu

Latest commit

 

History

12 Commits
12 Commits

Folders and files

NameName
Last commit message
Last commit date
assets
assets
 
 
include
include
 
 
sh2
sh2
 
 
src
src
 
 
CMakeLists.txt
CMakeLists.txt
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

BNO08x Raspberry Pi Pico RP2040 Library

This library is a refactoring of Mark Mellors' work who made the BNO08x IMU compatible with the Raspberry Pi Pico RP2040 SDK.

Description

This library was designed to work in I2C with the BNO08x. By default the i2c0 and the GP4 and GP5 are used in this project.

Raspberry Pi Pico and BNO085

Raspberry Pi Pico connected using I2C to the BNO085 - Schematic created with Fritzing

Motivation

Initially developed for the osod24_firmware project, this library was originally tailored specifically to its requirements. There arose a need for a more generalized version to make this resource more widely accessible.
This project remains the sole documentation I've encountered regarding the utilization of the BNO08x with the Raspberry Pi Pico, a resource not readily available elsewhere. Enhancing its accessibility could prove beneficial to others beyond just myself.

Project Structure

The project is structured as follows:

BNO08x_Pico_Library
├── CMakeLists.txt
├── assets
├── include
│   ├── bno08x.h
│   └── utils.h
├── README.md
├── sh2
│   ├── CMakeLists.txt
│   ├── include
│   │   ├── NOTICE.txt
│   │   ├── sh2_err.h
│   │   ├── sh2.h
│   │   ├── sh2_hal.h
│   │   ├── sh2_SensorValue.h
│   │   ├── sh2_util.h
│   │   └── shtp.h
│   └── src
│       ├── sh2.c
│       ├── sh2_SensorValue.c
│       ├── sh2_util.c
│       └── shtp.c
└── src
    ├── bno08x.cpp
    └── utils.cpp

The specification of Raspberry Pi Pico pins used for I2C, with I2C0 being the default, and the ability to set the I2C baud rate, are defined in utils.h:

BNO08x_Pico_Library
└── include
    └── utils.h

Requirements

  • piko-sdk

Installation

To use this library, clone the repository into your Raspberry Pi Pico RP2040 project directory:

git clone https://github.com/robotcopper/BNO08x_Pico_Library.git

Then include it in your project's CMakeLists.txt file:

add_subdirectory(
	BNO08x_Pico_Library
)

target_link_libraries(main
    BNO08x_Pico_Library
)

Usage

Here's a simple example demonstrating how to use the library to initialize the sensor and read orientation data:

#include "bno08x.h"

i2c_inst_t* i2c_port0;
initI2C(i2c_port0, false);
//set up IMU
while (IMU.begin(CONFIG::BNO08X_ADDR, i2c_port0)==false) {
    printf("BNO08x not detected at default I2C address. Check wiring. Freezing\n");
    scan_i2c_bus();
    sleep_ms(1000);
}
IMU.enableRotationVector();

while (true) {

    float yaw = 0.0f;

    if (IMU.getSensorEvent() == true) {
        if (IMU.getSensorEventID() == SENSOR_REPORTID_ROTATION_VECTOR) {
            yaw = IMU.getYaw();
        }
    }

    printf("Yaw: %.2f rad\n", yaw);

}

Credits and Contributions

  1. Original Developer:
      SparkFun
    :

    • Nathan Seidle @ SparkFun Electronics
    • Date: December 28, 2017

         Adjustments :

    • Pete Lewis @ SparkFun Electronics
    • Date: June 2023
    • To incorporate the CEVA Sensor Hub Driver: CEVA SH2

         Links :

    • Link to SparkFun_BNO08x_Arduino_Library GitHub repository: SparkFun_BNO08x_Arduino_Library
  2. Porting :

    • Use of External Code :
      • Code from Adafruit BNO08x Arduino Library by Bryan Siepert for Adafruit Industries: Adafruit_BNO08x
      • Use of I2C and SPI read/write functions and code from Adafruit BusIO library: Adafruit_BusIO
    • Ported by Mark Mellors for use on RP2040

About

Raspberry Pi Pico RP2040 library pico-sdk compatible to use the BNO08x IMU

Topics

bno080bno085bno08xcppimulibrarypicopico-sdkraspberry-pi-pico

Resources

Readme
BSD-3-Clause license
Activity

Stars

11 stars

Watchers

1 watching

Forks

7 forks
Report repository

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.