diff --git a/folkrace.py b/folkrace.py index 0799846..854c324 100644 --- a/folkrace.py +++ b/folkrace.py @@ -66,7 +66,7 @@ def turnleft(): while True: print("F=", f"{front.distance:.2f}", "R=", f"{right.distance:.2f}", "L=", f"{left.distance:.2f}") try: - if front.distance >= 20: # What to do when there is an obstacle ahead + if front.distance <= 20: # What to do when there is an obstacle ahead if left.distance > right.distance: # Diagonally left dgleft() if right.distance > left.distance: # Diagonally right