Trying to work with a BNO085 IMU via I2C using Adafruit unified sensor library #1324
-
HI, I've recently been trying to port a program to this framework and it includes the Adafruit BNO08X library. Does anyone have any experience with the BNO085 on this Platform at all? Is there an alternative library to use? I have previously got this to work using the I2C integration via MBedOS, where I created an MBedI2C TwoWire on the same pins as now and used it for the initialization and communication. This approach took a solid 7 ms to read data that was supposed to be available every 1 ms tho, which is why I would like to make this more efficient. Edit: I also attempted to use the Library created by Sparkfun with no results. It is quite similar to the Adafruit library but slimmer. Use of those libraries might not actually be possible. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
I'm able to connect BNO085 to Pico's i2c and operate it using ceva's drivers. I had a little trouble treating the i2c reception, but solved the problem by reading the 4-byte header containing the data size and then reading all the data at that size. int IIC_Receive(uint8_t addr, uint8_t *dat, int buflen) {
int result = 0;
TSHTPHeader *h = (TSHTPHeader *)(void *)dat;
int l = i2c_read_blocking(i2c0, addr, dat, 4, false);
l = h->Length & ~0x8000;
if (l > 0 && l <= buflen) {
l = i2c_read_blocking(i2c0, addr, dat, l, false);
if (l > 0) {
l = h->Length & ~0x8000;
if (l > 0) result = l;
}
}
return result;
} The data update cycle depends on the i2c bus speed and polling cycle, so requests that exceed this cycle are meaningless. |
Beta Was this translation helpful? Give feedback.
-
I have succeeded in getting the Sparkfun library to work. What I did is instead of freezing when the BNO is not seen by Wire, just By the way, the SH2 library mentioned above is a dependency of Sparkfun's library. |
Beta Was this translation helpful? Give feedback.
I'm able to connect BNO085 to Pico's i2c and operate it using ceva's drivers.
I had a little trouble treating the i2c reception, but solved the problem by reading the 4-byte header containing the data size and then reading all the data at that size.
The data update cycle depends on the i2c bus spee…