Re: BNO055 quaternion data missing
by adafruit_support_mike on Wed Apr 07, 2021 11:10 pm
Connection errors are always possible. There might be some noise on the data lines, or the request might come at a moment when the sensor isn't ready to answer.
It could also be a timing issue.. the BNO055 uses a method called 'clock stretching' to let the bus controller know it needs time to think. When the bus controller sends a signal with the BNO055's address, the BNO055 holds the SCL line low until it's ready to answer.
There's always a chance that a device stretching the clock will hang for an unreasonable amount of time, so the bus controller will give up after a certain amount of time. That timeout might be less time than the device needs to process an answer, so there's a chance that the microcontroller will give up before it gets a valid answer.
It's best to write code around the assumption that sensor readings will occasionally fail, and to have a fallback option when they do. That can be as simple as ignoring the attempt, or taking another reading, or can get complex with default values based on the recent data.