Chapter 10 code

This commit is contained in:
Danny Staple
2022-08-01 09:52:56 +01:00
parent 35358211ac
commit 7eff69d680
23 changed files with 1517 additions and 170 deletions
@@ -25,6 +25,8 @@ while True:
distance = robot.left_distance.distance
error = distance_set_point - distance
speed = distance_controller.calculate(error)
if abs(speed) < 0.2:
speed = 0
uart.write(f"{error},{speed}\n".encode())
print(f"{error},{speed}")
robot.set_left(speed)