Ashfaque Khan
Ashfaque Khan

Reputation: 66

Adafruit BNO08x Lib Not working with PicoRP2040 - PlatformIO

I was trying to connect the BNO08x IMU Breakout board with Pico RP2040, I tried connecting it to both the I2C ports, but it didnt worked. I am using the official Adafruit BNO08x lib. Below is the part of Example code included in the lib which I was trying to run:

#include <Adafruit_BNO08x.h>

// For SPI mode, we need a CS pin
#define BNO08X_CS 10
#define BNO08X_INT 9

// For SPI mode, we also need a RESET 
// #define BNO08X_RESET 5
// but not for I2C or UART
#define BNO08X_RESET -1

Adafruit_BNO08x  bno08x(BNO08X_RESET);
sh2_SensorValue_t sensorValue;

void setup(void) {
  Serial.begin(115200);
  while (!Serial) delay(10); // will pause Zero, Leonardo, etc until serial console opens

  Serial.println("Adafruit BNO08x test!");

  // Try to initialize!
  if (!bno08x.begin_I2C()) {
  // if (!bno08x.begin_UART(&Serial1)) { // Requires a device with > 300 byte UART buffer!
  // if (!bno08x.begin_SPI(BNO08X_CS, BNO08X_INT)) {
    Serial.println("Failed to find BNO08x chip");
    while (1) { delay(10); }
  }
  Serial.println("BNO08x Found!"); 

I change the framework from Arduino to Earphilhower too, it didnt work. Soon realised that I need to change the I2C pin defination, not sure how to do that, also this was the message I got in the serial monitor:

1Adafruit BNO08x test!
I2C address not found
Failed to find BNO08x chip

Upvotes: 0

Views: 143

Answers (1)

This library depends on Adafruit BusIO and unified sensor libraries, you need to download and include them in the code

Upvotes: -1

Related Questions