7

on the line kit = MotorKit(), the error diagnostic is:

ValueError: No Hardware I2C on (scl,sda)=(3, 2)


quality standards quality standards quality standards quality standards quality standards quality standards quality standards quality standards quality standards quality standards

2 Answers 2

9

The fix is to use raspi-config to activate the I2C port.

I'm documenting this because the interthing had no link from that misleading error message to this fix, because nobody except me forgot to activate the I2C port.

1
0

The answer provided by @Phlip is correct (I2C must be enabled via raspi-config) though you can also bump into this when trying to use other I2C ports (software or hardware) aside from the primary one.

In that case the fix is to use the Adafruit_Python_Extended_Bus library to create a custom I2C object. This worked for me for the ServoKit library.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.