23 global last_time_motors_init
28 mc.set_max_acceleration(1, 70)
29 mc.set_max_deceleration(1, 150)
32 mc.set_max_acceleration(2, 100)
33 mc.set_max_deceleration(2, 150)
36 mc.set_max_acceleration(3, 40)
37 mc.set_max_deceleration(3, 150)
39 mc.clear_motor_fault_unconditional()
41 except (OSError, RuntimeError)
as e:
42 print(
"Error: motors_init:", e, file=sys.stderr)
44 last_time_motors_init = time.monotonic()
48except (OSError, RuntimeError):
56 if int(time.monotonic() * 1000) & 2048:
62 except (OSError, RuntimeError):
67 if time.monotonic() - last_time_motors_init > 2:
72except KeyboardInterrupt:
Represents an I2C connection to a Pololu Motoron Motor Controller.