Simple test

Ensure your device works with this simple test.

examples/motor_control_simpletest.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
"""Motor control test"""
import time
import makers_motor_control

motors = makers_motor_control.MotorControl()

motors.set_throttle(0.0, 0.0)

while True:
    motors.set_throttle(0.5, 0.5, 0.25, True)   # forward
    motors.set_throttle(-0.5, -0.5, 0.25, True) # backward
    motors.set_throttle(0.0, 0.5, 0.25, True)   # left
    motors.set_throttle(0.5, 0.0, 0.25, True)   # right

    time.sleep(5.0)