You can use M5Stack's MPU6886 Library with Mahony/Madgwick Filter
M5Stack provides an official MPU6886 library:
- GitHub: GitHub - m5stack/M5StickC-Plus: M5StickCPlus Arduino Library
- It allows you to easily get
accelandgyrodata.
Then you can feed that into a sensor fusion algorithm such as:
Madgwick Filter:
- Lightweight and fast
- Good for microcontrollers
GitHub: Madgwick AHRS or Arduino-compatible fork