Adafruit BNO08x Lib 无法与 PicoRP2040 - PlatformIO 配合使用

问题描述 投票:0回答:1

我试图将 BNO08x IMU 分线板与 Pico RP2040 连接,我尝试将其连接到两个 I2C 端口,但没有成功。 我正在使用官方 Adafruit BNO08x 库。 以下是我尝试运行的库中包含的示例代码的一部分:

#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!"); 

我也将框架从Arduino更改为Earphilhower,但没有用。 很快意识到我需要更改 I2C 引脚定义,不知道该怎么做,这也是我在串行监视器中收到的消息:

1Adafruit BNO08x test!
I2C address not found
Failed to find BNO08x chip
arduino i2c adafruit platformio rp2040
1个回答
0
投票

该库依赖于Adafruit BusIO和统一传感器库,您需要下载并将它们包含在代码中

© www.soinside.com 2019 - 2024. All rights reserved.