Guide to gyro and accelerometer with Arduino including Kalman filtering

You can not measure the yaw like that. The problem is that accZangle is not correct. Because accZangle is not affected when rotation the sensor, as I described earlier.

When I wrote calibrating I mean that you should keep doing this:

gyroZeroZ = calibrateGyroZ();

The reason why I outcommented it, is because it drifts, and I do not use it anywhere.

  • Lauszus