I tried to run Jetbot’s ‘Example 1 - Basic Motion’ but encountered an error after ‘robot.left(speed=0.3)’
OSError Traceback (most recent call last)
in
----> 1 robot.left(speed=0.3)
/usr/local/lib/python3.6/dist-packages/jetbot-0.3.0-py3.6.egg/jetbot/robot.py in left(self, speed)
37
38 def left(self, speed=1.0):
—> 39 self.left_motor.value = -speed
40 self.right_motor.value = speed
41
/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py in set(self, obj, value)
582 raise TraitError(‘The “%s” trait is read-only.’ % self.name)
583 else:
→ 584 self.set(obj, value)
585
586 def _validate(self, obj, value):
/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py in set(self, obj, value)
571 # we explicitly compare silent to True just in case the equality
572 # comparison above returns something other than True/False
→ 573 obj._notify_trait(self.name, old_value, new_value)
574
575 def set(self, obj, value):
/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py in _notify_trait(self, name, old_value, new_value)
1203 new=new_value,
1204 owner=self,
→ 1205 type=‘change’,
1206 ))
1207
/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py in notify_change(self, change)
1208 def notify_change(self, change):
1209 “”“Notify observers of a change event”“”
→ 1210 return self._notify_observers(change)
1211
1212 def _notify_observers(self, event):
/usr/local/lib/python3.6/dist-packages/traitlets/traitlets.py in _notify_observers(self, event)
1245 c = getattr(self, c.name)
1246
→ 1247 c(event)
1248
1249 def _add_notifiers(self, handler, name, type):
/usr/local/lib/python3.6/dist-packages/jetbot-0.3.0-py3.6.egg/jetbot/motor.py in _observe_value(self, change)
22 @traitlets.observe(‘value’)
23 def _observe_value(self, change):
—> 24 self._write_value(change[‘new’])
25
26 def _write_value(self, value):
/usr/local/lib/python3.6/dist-packages/jetbot-0.3.0-py3.6.egg/jetbot/motor.py in _write_value(self, value)
30 self._motor.setSpeed(speed)
31 if mapped_value < 0:
—> 32 self._motor.run(Adafruit_MotorHAT.FORWARD)
33 else:
34 self._motor.run(Adafruit_MotorHAT.BACKWARD)
/usr/local/lib/python3.6/dist-packages/Adafruit_MotorHAT-1.4.0-py3.6.egg/Adafruit_MotorHAT/Adafruit_MotorHAT_Motors.py in run(self, command)
198 return
199 if (command == Adafruit_MotorHAT.FORWARD):
→ 200 self.MC.setPin(self.IN2pin, 0)
201 self.MC.setPin(self.IN1pin, 1)
202 if (command == Adafruit_MotorHAT.BACKWARD):
/usr/local/lib/python3.6/dist-packages/Adafruit_MotorHAT-1.4.0-py3.6.egg/Adafruit_MotorHAT/Adafruit_MotorHAT_Motors.py in setPin(self, pin, value)
238 raise NameError(‘Pin value must be 0 or 1!’)
239 if (value == 0):
→ 240 self._pwm.setPWM(pin, 0, 4096)
241 if (value == 1):
242 self._pwm.setPWM(pin, 4096, 0)
/usr/local/lib/python3.6/dist-packages/Adafruit_MotorHAT-1.4.0-py3.6.egg/Adafruit_MotorHAT/Adafruit_PWM_Servo_Driver.py in setPWM(self, channel, on, off)
88 self.i2c.write8(self.__LED0_ON_L+4channel, on & 0xFF)
89 self.i2c.write8(self.__LED0_ON_H+4channel, on >> 8)
—> 90 self.i2c.write8(self.__LED0_OFF_L+4channel, off & 0xFF)
91 self.i2c.write8(self.__LED0_OFF_H+4channel, off >> 8)
92
/usr/local/lib/python3.6/dist-packages/Adafruit_GPIO-1.0.3-py3.6.egg/Adafruit_GPIO/I2C.py in write8(self, register, value)
114 “”“Write an 8-bit value to the specified register.”“”
115 value = value & 0xFF
→ 116 self._bus.write_byte_data(self._address, register, value)
117 self._logger.debug(“Wrote 0x%02X to register 0x%02X”,
118 value, register)
/usr/local/lib/python3.6/dist-packages/Adafruit_PureIO-0.2.3-py3.6.egg/Adafruit_PureIO/smbus.py in write_byte_data(self, addr, cmd, val)
254 # Send the data to the device.
255 self._select_device(addr)
→ 256 self._device.write(data)
257
258 def write_word_data(self, addr, cmd, val):
OSError: [Errno 121] Remote I/O error