You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In your function dmpDataReady, instead of setting IMUdataReady = 1, try incrementing the value, then in your main loop, read the data IMUdataReady times to clear the FIFO and decrement that counter with each loop.
This will prevent fifo overflow and give you the most recent value from the IMU.
I would have added this to code and created a PR but part 19 isn't up.
void dmpDataReady() {
IMUdataReady++;
}
...main loop...
// IMU test
while (IMUdataReady > 0) {
readAngles();
IMUdataRead--;
}
The text was updated successfully, but these errors were encountered:
Ah, fair enough.
Perhaps then for your use case, you don’t really need a FIFO buffer, you just want the latest value.
Could you disable the FIFO? Set the rate to max and just manually read the values in your main loop? That way you’ll always get the newest value and won’t need to read multiple times from the FIFO at a lower rate.
On Jun 25, 2019, at 8:24 AM, James Bruton ***@***.***> wrote:
According to the example code it'll read multiple values out of the FIFO when the function is called anyway, so it should never leave anything behind.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
In your function dmpDataReady, instead of setting IMUdataReady = 1, try incrementing the value, then in your main loop, read the data IMUdataReady times to clear the FIFO and decrement that counter with each loop.
This will prevent fifo overflow and give you the most recent value from the IMU.
I would have added this to code and created a PR but part 19 isn't up.
...main loop...
The text was updated successfully, but these errors were encountered: