Open svkers opened 1 year ago
Hi @svkers, I added a clarification of this solution if you want to understand what is going on with this. Check out the #319 for my comment if you're interested.
Man I can't tell you how much time I wasted on this topic. I didn't ever think the implementation could be the source of the problem. I spent 6 days in span of 3 months try to get reading from 3 different sensors, the last one which I ordered new try to narrow down the problem.
The provided example for the MPU6050 does not work as expacted: It only returns 0x00 instead of the real gyro, accel and temp values.
After struggeling several time I finally managed to get real values from the MPU6050 by changing the following code line:
to
The MPU-6500 Register Map and Descriptions Revision 2.1 states that register 0x6B is the PWR_MGMT_1 register:
DEVICE_RESET SLEEP CYCLE GYRO_STANDBY TEMP_DIS CLKSEL[2:0]
So setting this register to 0x80 (binary: 1000 0000) means that the bit DEVICE_RESET is set to 1 whereas all other bits are set to 0. The document also states for this register and bit the following: DEVICE_RESET 1 – Reset the internal registers and restores the default settings. Write a 1 to set the reset, the bit will auto clear.
Since I am quite new to Pico and electronics I would be really glad for further clarification. Thanks!
Note: I faced this issue with various MPU6050 boards that I tested.