i2cdevlib icon indicating copy to clipboard operation
i2cdevlib copied to clipboard

MPU6050/MPU6050.cpp initialize() should call setSleepEnabled first, not last

Open drsteveplatt opened this issue 4 years ago • 1 comments

The current code, setClockSource(MPU6050_CLOCK_PLL_XGYRO); setFullScaleGyroRange(MPU6050_GYRO_FS_250); setFullScaleAccelRange(MPU6050_ACCEL_FS_2); setSleepEnabled(false); // thanks to Jack Elston for pointing this one out! should be setSleepEnabled(false); // thanks to Jack Elston for pointing this one out! setClockSource(MPU6050_CLOCK_PLL_XGYRO); setFullScaleGyroRange(MPU6050_GYRO_FS_250); setFullScaleAccelRange(MPU6050_ACCEL_FS_2); I find that setClockSource etc. are not executed if the device is still asleep.

drsteveplatt avatar Apr 24 '20 18:04 drsteveplatt

Had some similar issues writing motion detection thresholds, had to make sure to wake the device before the values sticked.

GitMoDu avatar Apr 27 '20 16:04 GitMoDu