@@ -0,0 +1,1261 @@
+import time%0Aimport timeit%0A%0Afrom motors import Motors%0A%0Adef wait_motors(motors):%0A    while not motors.is_done():%0A        time.sleep(0.1)%0A%0Adef test_regul():%0A    %22%22%22%0A    Make a square with the robot and at the end make it turn the%0A    other direction  (just for fun).%0A    %22%22%22%0A    DISTANCE = 50%0A    ANGLE = 90%0A%0A    motors = Motors(5)%0A    motors.forward(DISTANCE)%0A    wait_motors(motors)%0A    motors.turn_left(ANGLE)%0A    wait_motors(motors)%0A    motors.forward(DISTANCE)%0A    wait_motors(motors)%0A    motors.turn_left(ANGLE)%0A    wait_motors(motors)%0A    motors.forward(DISTANCE)%0A    wait_motors(motors)%0A    motors.turn_left(ANGLE)%0A    wait_motors(motors)%0A    motors.forward(DISTANCE)%0A    wait_motors(motors)%0A    # We can't turn more than 255 degrees because%0A    # the data send to the Arduino is a 8bits value.%0A    motors.turn_right(180)%0A    wait_motors(motors)%0A    motors.turn_right(90)%0A    wait_motors(motors)%0A%0A%0Aif __name__ == '__main__':%0A    # Display the time that the regulation has taken.%0A    # Could be used to improve the regulation parameter.%0A    t = timeit.timeit('test_regul()', setup='from __main__ import test_regul')%0A%0A    # Cleaner but this API is only valid for %3E python3.5%0A    # t = timeit.timeit('test_regul()', globals=globals(), number=1)%0A%0A    print(t)%0A

add script to test regulation