Skip to content

IMU data reads #21

@alanbithell

Description

@alanbithell

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--;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions