Open ImVictorYT opened 1 year ago
sometimes the angle z keeps increasing with out movemnt Find the following line in the MPU6050_light.cpp file
accX = ((float)rawData[0]) / ACC_LSB_2_G;
accY = ((float)rawData[1]) / ACC_LSB_2_G;
accZ = ((float)rawData[2]) / ACC_LSB_2_G;
temp = (rawData[3] + TEMP_LSB_OFFSET) / TEMP_LSB_2_DEGREE;
gyroX = ((float)rawData[4]) / GYRO_LSB_2_DEGSEC - gyroXoffset;
gyroY = ((float)rawData[5]) / GYRO_LSB_2_DEGSEC - gyroYoffset;
gyroZ = ((float)rawData[6]) / GYRO_LSB_2_DEGSEC - gyroZoffset;
Please add the line below
if(gyroZ>-0.4 && gyroZ<0.4) {gyroZ=0;}
sometimes the angle z keeps increasing with out movemnt