arduino程序,自动计算MPU6050的offset,显示如下:
Sensor readings with offsets: 0 0 16391 -2 0 0
Your offsets: -1495 -454 2369 58 -36 31
Data is printed as: acelX acelY acelZ giroX giroY giroZ
Check that your sensor readings are close to 0 0 16384 0 0 0
If calibration was succesful write down your offsets so you can set them in your projects using something similar to mpu.setXAccelOffset(youroffset)
简单快速,把该偏移带入mpu6050替换下面的值:
// supply your own gyro offsets here, scaled for min sensitivity
mpu.setXAccelOffset(-1495);
mpu.setYAccelOffset(-454);
mpu.setZAccelOffset(2369);
mpu.setXGyroOffset(58);
mpu.setYGyroOffset(-36);
mpu.setZGyroOffset(31); // 1688 factory default for my test chip 。
1