Adafruit_BNO08x
Adafruit_BNO08x copied to clipboard
getSensorEvent never returns false
-
Arduino board: Teensy 4.1
-
Arduino IDE version: Arduino Extension in VS Code Version 0.6.0 using Arduino CLI 0.31.0
Hi, i am using the BNO085 connected via UART.
I discovered a problem with Adafruit_BNO08x::getSensorEvent
It never return false, if no new data is available. So it basically waits until new data is there, which is a problem, if the µc wants to do anything else on a rate, that is higher than the refresh rate of the bno.
The condition for return false is timestamp and sensorId.
bool Adafruit_BNO08x::getSensorEvent(sh2_SensorValue_t *value) {
_sensor_value = value;
value->timestamp = 0;
sh2_service();
if (value->timestamp == 0 && value->sensorId != SH2_GYRO_INTEGRATED_RV) {
// no new events
return false;
}
return true;
}
I printed out timestamp right before and it behaves really weird. If data is available timestamp is one of the following numbers. 4294963496 or 4294963896 or 4294964596 or 4294964996 or 4294965296 or ...
I couldn't find where and how timestamp is set, but something is wrong here. Issue #22 seems to talk about the same issue.