From b2a83f6438e045495f994f56a9cc0441c52c13f5 Mon Sep 17 00:00:00 2001 From: Andrey Pohilko Date: Sat, 16 Sep 2017 21:24:55 +0300 Subject: [PATCH] Remove non-working thing --- vernie/run_away_game.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/vernie/run_away_game.py b/vernie/run_away_game.py index 3ee1749..680fb04 100644 --- a/vernie/run_away_game.py +++ b/vernie/run_away_game.py @@ -7,16 +7,11 @@ robot.say("Place your hand in front of sensor") def callback(color, distance): - if color == COLOR_WHITE: - robot.motor_AB.timed(0.1, 0.2, async=True) - elif color != COLOR_NONE: - print(color) - else: - speed = (10 - distance + 1) / 10.0 - secs = (10 - distance + 1) / 10.0 - print("Distance is %.1f inches, I'm running back with %s%% speed!" % (distance, int(speed * 100))) - if speed <= 1: - robot.motor_AB.timed(secs / 1, -speed, async=True) + speed = (10 - distance + 1) / 10.0 + secs = (10 - distance + 1) / 10.0 + print("Distance is %.1f inches, I'm running back with %s%% speed!" % (distance, int(speed * 100))) + if speed <= 1: + robot.motor_AB.timed(secs / 1, -speed, async=True) def on_btn(pressed):