I'm doing a project with the MPU6050 accelerometer. First I calculate the offsets of the MPU only once executing the sketch of Luis RĂ³denas.
Later, once I get the offsets, I copy them into the configuration of a second sketch and I always execute it with the same values.
//Placa casa MPU6050 viejo
//-1172 -873 1351 76 -758 27
accelgyro.setXAccelOffset(-1172);
accelgyro.setYAccelOffset(-873);
accelgyro.setZAccelOffset(1351);
accelgyro.setXGyroOffset(76);
accelgyro.setYGyroOffset(-773);
accelgyro.setZGyroOffset(33);
The problem I have is that after a time of having executed the second sketch several times, the raw readings present a new offset.
I read that this problem can be by the temperature of the sensor, that it is necessary to compensate the readings with the temperature. But I can not find an example to do so. I wanted to ask if anyone knows what the problem might be and how I can fix it.