
Wire.begin() // Initialize comunication.float elapsedTime, currentTime, previousTime.float AccErrorX, AccErrorY, GyroErrorX, GyroErrorY, GyroErrorZ.float accAngleX, accAngleY, gyroAngleX, gyroAngleY, gyroAngleZ.const int MPU = 0圆8 // MPU6050 I2C address.Arduino and MPU6050 Accelerometer and Gyroscope Sensor Tutorial.The MPU6050 IMU is also called six-axis motion tracking device or 6 DoF (six Degrees of Freedom) device, because of its 6 outputs, or the 3 accelerometer outputs and the 3 gyroscope outputs. So, if we fuse, or combine the accelerometer and gyroscope data we can get very accurate information about the sensor orientation. Briefly, it can measure gravitational acceleration along the 3 axes and using some trigonometry math we can calculate the angle at which the sensor is positioned. On the other hand, the MPU6050 accelerometer measures acceleration in the same way as explained in the previous video for the ADX元45 accelerometer sensor. The outputs of the gyroscope are in degrees per second, so in order to get the angular position we just need to integrate the angular velocity.


It uses MEMS technology and the Coriolis Effect for measuring, but for more details on it you can check my particular How MEMS Sensors Work tutorial. The gyroscope measures rotational velocity or rate of change of the angular position over time, along the X, Y and Z axis. The MPU6050 IMU has both 3-Axis accelerometer and 3-Axis gyroscope integrated on a single chip.
