Note: Interface selection is typically done via hardware pins (PS0/PS1) at boot time. This method is only useful if your hardware allows dynamic control of these pins.
Hardware Pin Control
Reset Control
1
2
// Hardware reset (if RSTN pin is wired)imu.HardwareReset(2);// Hold reset low for 2ms
Boot Pin Control (DFU Mode)
1
2
3
// Set BOOTN pin low to enter bootloader modeimu.SetBootPin(true);// Active low, so true = lowimu.HardwareReset(10);// Reset while BOOTN is low
Wake Pin Control (SPI Mode)
1
2
// Pull WAKE pin low to wake sensor from suspendimu.SetWakePin(true);// Active low
Data Access Modes
Callback Mode (Recommended)
1
2
3
4
imu.SetCallback([](constbno08x::SensorEvent&e){// Process event immediately});imu.Update();// Call frequently
Polling Mode
1
2
3
4
5
6
imu.Update();// Must be called frequentlyif(imu.HasNewData(bno08x::BNO085Sensor::RotationVector)){autoevent=imu.GetLatest(bno08x::BNO085Sensor::RotationVector);// Process event}
Sensor Accuracy
The SensorEvent structure includes an accuracy field (0-3) indicating calibration status:
0: Unreliable - sensor not calibrated
1: Low accuracy - calibration in progress
2: Medium accuracy - partially calibrated
3: High accuracy - fully calibrated
Recommendation: Wait for accuracy = 3 before trusting orientation data, especially for heading/yaw.
Power Management
Disable Unused Sensors
To save power, disable sensors you don’t need:
1
2
3
// Only enable what you needimu.EnableSensor(bno08x::BNO085Sensor::RotationVector,10);// Don't enable other sensors if not needed
Update Frequency
Call Update() as frequently as possible for best performance. The driver is designed to be called from:
Main loop
RTOS task
Interrupt service routine (ISR)
Timer callback
Default Configuration
After Begin(), the sensor is initialized with:
No sensors enabled (must enable explicitly)
No callbacks registered
Default sensor fusion settings
Auto re-sync enabled (detects resets and re-enables configured sensors)