I've been trying to talk to my MPU6050 with a Pi Pico running MicroPython. I can verify the I2C is working because when running i2c.scan()
, I get the MPU6050 address(0x68). However, when trying to read a specific register from the MPU6050, I always get 0x00, except for when I read the WHO_AM_I register, which just gives me the letter h??? I have my code below, I hope I'm just being an idiot that doesn't know I2C, because I've never even touched it until today. If anybody can help me, it would be greatly appreciated!
import machine
sda = machine.Pin(4)
scl = machine.Pin(5)
i2c = machine.I2C(0, sda = sda, scl = scl)
i2c.writeto(0x68, b'\x42') # Read the TEMP_OUT_L register
gyro = i2c.readfrom(0x68, 1)
print(gyro)
I've provided a link to the datasheet of my MPU6050 right here, again, any help would be appreciated!