Hi all,

I'm searching on web aboyt how to combining accelerometer and gyroscope data and I found this:

"

First you need to integrate the output from the gyro to get the actual X, Y and Z angles.

```
angleX = gyroAngleX + gyroInputX
angleY = gyroAngleY + gyroInputY
```

However this value will drift over time so you will need to use a complementary filter or kalman filter. Personally, I would recommend a complementary filter because it is much simpler to implement.

First you must find the angle from the accelerometer using a little bit of trigonometry.

```
accelAngleX = atan2(accelY, accelZ) * 180/M_PI;
accelAngleY = atan2(-accelX, sqrt(accelY*accelY + accelZ*accelZ)) * 180/M_PI;
```

Then get the actual angle using this formula.

```
angleX = 0.98*angleX + 0.02*accelAngleX
angleY = 0.98*angleY + 0.02*accelAngleY
```

The variables above must be the same variables used when calculating the gyro angle. The 0.98 and 0.02 can be tuned to get the best output, but they should always add up to one.

"

but I can't understand these lines:

```
angleX = gyroAngleX + gyroInputX
angleY = gyroAngleY + gyroInputY
```

what gyroAngleX and gyroInputX are.

If anyone know please help.

Thanks!!