A library that fuses accelerometer and gyroscope readings quickly and easily with a complementary filter.
This library combines accelerometer (in meters / second ²) and gyroscope (in radians / second) data to output the IMU's rotation (Euler angles). It is accurate up to ± 90 degrees.
Note the the lxibrary defines pitch to be a rotation about the y-axis and roll to be a rotation about the x-axis.
Here's a comparison of different high-speed methods for estimating pitch and roll.
The complementary filter returns smooth readings despite non-zero acceleration.