diff --git a/python/IRremote_UltrasonicObstacleAvoidance.py b/python/IRremote_UltrasonicObstacleAvoidance.py index dabb231..98ccb00 100644 --- a/python/IRremote_UltrasonicObstacleAvoidance.py +++ b/python/IRremote_UltrasonicObstacleAvoidance.py @@ -117,15 +117,15 @@ try: Ab.setPWMB(PWM) print(PWM) else: - if dist < 20: - n = 0 - Ab.stop() - print("run into obstabcle") - else: - n += 1 - if n > 20000: + if dist < 20: n = 0 - Ab.stop() + Ab.stop() + print("run into obstabcle") + else: + n += 1 + if n > 20000: + n = 0 + Ab.stop() except KeyboardInterrupt: GPIO.cleanup();