I’m trying to test this IMU for a project I’m helping with, and I’ve gone through the [hookup guide and set everything up, but the examples aren’t working for some reason.
None of the Arduino examples from the library seem to be actually reading or outputting any of the information from the IMU, but it is on and connected like the hookup guide shows it should be. This is also a brand new board so none of the parts should be broken or anything.
With the first example listed (RotationVector) every time I run the code I get “BNO080 not detected at default I2C address. Check your jumpers and the hookup guide. Freezing…” in the serial monitor, despite everything being plugged in as shown in the guide.
Also, here’s the code for the first example in case no one wants to download/find it themselves
/*
Using the BNO080 IMU
By: Nathan Seidle
SparkFun Electronics
Date: December 21st, 2017
License: This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
Feel like supporting our work? Buy a board from SparkFun!
https://www.sparkfun.com/products/14586
This example shows how to output the i/j/k/real parts of the rotation vector.
https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation
It takes about 1ms at 400kHz I2C to read a record from the sensor, but we are polling the sensor continually
between updates from the sensor. Use the interrupt pin on the BNO080 breakout to avoid polling.
Hardware Connections:
Attach the Qwiic Shield to your Arduino/Photon/ESP32 or other
Plug the sensor onto the shield
Serial.print it out at 9600 baud to serial monitor.
*/
#include <Wire.h>
#include "SparkFun_BNO080_Arduino_Library.h"
BNO080 myIMU;
void setup()
{
Serial.begin(9600);
Serial.println();
Serial.println("BNO080 Read Example");
Wire.begin();
if (myIMU.begin() == false)
{
Serial.println("BNO080 not detected at default I2C address. Check your jumpers and the hookup guide. Freezing...");
while (1);
}
Wire.setClock(400000); //Increase I2C data rate to 400kHz
myIMU.enableRotationVector(50); //Send data update every 50ms
Serial.println(F("Rotation vector enabled"));
Serial.println(F("Output in form i, j, k, real, accuracy"));
}
void loop()
{
//Look for reports from the IMU
if (myIMU.dataAvailable() == true)
{
float quatI = myIMU.getQuatI();
float quatJ = myIMU.getQuatJ();
float quatK = myIMU.getQuatK();
float quatReal = myIMU.getQuatReal();
float quatRadianAccuracy = myIMU.getQuatRadianAccuracy();
Serial.print(quatI, 2);
Serial.print(F(","));
Serial.print(quatJ, 2);
Serial.print(F(","));
Serial.print(quatK, 2);
Serial.print(F(","));
Serial.print(quatReal, 2);
Serial.print(F(","));
Serial.print(quatRadianAccuracy, 2);
Serial.print(F(","));
Serial.println();
}
}
I also apologize if this is something super simple that I’m not getting or I’m not providing enough info. I’m still new to both coding and arduino/circuitry and I’m kinda stupid.](Qwiic VR IMU (BNO080) Hookup Guide - SparkFun Learn)