How do you regain full functionality from the MPU6050
I tested your code and now I cant access gyro data when I try to run a basic sketch.
How do you set the register to default?
https://wolles-elektronikkiste.de/en/mpu6050-accelerometer-and-gyroscope
Wolfgang EwaldSeptember 20, 2024 Very strange, since all registers should be set to default values, when you disconnect the MPU6050 from power supply, and then re-connect. Also, writeByte( MPU6050_ADDRESS, 0x6C, 7); should not have a permanent effect.
What could happen is the following: you upload the sketch which deactivates the gyroscope. Then you upload another sketch (without re-powering in between) which does not change the register 0x6C. In that case, the gyroscope still won’t work. But latest when you then re-power the MPU6050 it should work. Have you tried to re-power after uploading another sketch?
If it still does not work, you can try to change the sketch that de-activated the gyroscope. Change line 109 from
writeByte( MPU6050_ADDRESS, 0x6C, 7);
to:
writeByte( MPU6050_ADDRESS, 0x6C, 0);
Regards, Wolfgang