Waveshare Jetbot motor library

Hi i had recently purchased the waveshare jetbot for trying out the jetbot examples.
I found out that nvidia uses the adafruit motor hat library for the motor control,so i wanted to try the example codes from the GitHub account of adafruit containing adafruit motor hat library.
i run into this error runtime error: could not determine default i2c bus for the platform.
Please help me

in the RobotTest file i encounter this error

no im still getting the same error
Traceback (most recent call last):
File “dc.py”, line 10, in
mh = Adafruit_MotorHAT(addr=0x60)
File “/usr/local/lib/python3.6/dist-packages/Adafruit_MotorHAT-1.4.0-py3.6.egg/Adafruit_MotorHAT/Adafruit_MotorHAT_Motors.py”, line 231, in init
self._pwm = PWM(addr, debug=False, i2c=i2c, i2c_bus=i2c_bus)
File “/usr/local/lib/python3.6/dist-packages/Adafruit_MotorHAT-1.4.0-py3.6.egg/Adafruit_MotorHAT/Adafruit_PWM_Servo_Driver.py”, line 57, in init
self.i2c = get_i2c_device(address, i2c, i2c_bus)
File “/usr/local/lib/python3.6/dist-packages/Adafruit_MotorHAT-1.4.0-py3.6.egg/Adafruit_MotorHAT/Adafruit_PWM_Servo_Driver.py”, line 21, in get_i2c_device
return I2C.get_i2c_device(address)
File “/usr/local/lib/python3.6/dist-packages/Adafruit_GPIO-1.0.4-py3.6.egg/Adafruit_GPIO/I2C.py”, line 65, in get_i2c_device
File “/usr/local/lib/python3.6/dist-packages/Adafruit_GPIO-1.0.4-py3.6.egg/Adafruit_GPIO/I2C.py”, line 57, in get_default_bus
RuntimeError: Could not determine default I2C bus for platform.

can you please help me in solving this error

Hi rahulsinghrox701 ,

Please refer to below topic to see if can help:

MY jetbot examples work but when i want to try the examples of GitHub - adafruit/Adafruit-Motor-HAT-Python-Library it shows the error mentioned above.

can anyone help me

Hi rahulsinghrox701,

Thanks for reaching out.

With JetBot we manually specify i2c_bus=1 for the Adafruit_MotorHAT library. See this line

I would guess you want to try adding that parameter to the Adfruit example as well

Please let me know if this helps or you run into any issues.

Best,
John

1 Like