Guide to gyro and accelerometer with Arduino including Kalman filtering

Lauszus:
@gerry87
Please send me a link to the library you are using, so I can see the code.

Also please see this code: https://github.com/TKJElectronics/Example-Sketch-for-IMU-including-Kalman-filter/blob/master/IMU6DOF/MPU6050/MPU6050.ino. It's shows a better way to calculate the angle using the accelerometers.

i2cdevlib/Arduino at master · jrowberg/i2cdevlib · GitHub here is the library, and here's the specific one for the L3G4200D i2cdevlib/Arduino/L3G4200D at master · jrowberg/i2cdevlib · GitHub

The better way you mention to calculate the angle is it:

 accYangle = (atan2(accX,accZ)+PI)*RAD_TO_DEG;
 accXangle = (atan2(accY,accZ)+PI)*RAD_TO_DEG;

Thanks, I'll try it when I get back home. Does this account for the 360 degrees (inverted)?