Closed tdrellich closed 3 years ago
You could have saved yourself writing this program, because it's already in the library. The functions getAccelODR() getGyroODR() and getMagnetODR() return the actual ODR value as was measured upon the last change in register settings. It is all explained in the documentation. Yes the original documentation is very inacurate about the actual odr values. That was the reason for doing it this way.
I'm using the Arduino Nano 33 BLE Sense board. If in my setup I have:
I would expect the ODR of the accelerometer and gyro to be 476Hz. however the
IMU.getAccelODR()
andIMU.getGyroODR()
commands return that I'm getting 469.61Hz. This wouldn't be particularly problematic, however, if I use the following loop:and then output
n_acc_measurement / 3.0
andn_gyro_measurements / 3.0
I'm getting a frequency of 143.33Hz