Raspberry Pi I2c Read/Write Error
Like many people, I've had a Pi for a while but never really done anything with it. I've finally got round to hooking up an MPU6050 IMU to play around with. It uses i2c for communi
Solution 1:
In normal cases you don't really need to change the /lib/udev/rules.d/60-i2c-tools.rules file, so I would recommend resinstalling raspbian.
Connect the MPU6050 to the correct pins:
Then download an official Adafruit library:
Check if the Raspberry Pi's I2C is enabled with $ sudo raspi-config
and make sure the I2C address is correct, besides checking it with $ i2cdetect -y 1
, like this:
try:
bus = Adafruit_I2C(address=0)
print("Default I2C bus is accessible")
except:
print("Error accessing default I2C bus")
mcp = None
for i in range(0x00, 0x28):
try:
mcp = Adafruit_MCP230XX(address=i, num_gpios=16)
break
except:
pass
Post a Comment for "Raspberry Pi I2c Read/Write Error"