From 1e48f23f61e5d06bae60943e546c7bc22653c78f Mon Sep 17 00:00:00 2001 From: Andrey Pohilko Date: Fri, 27 Dec 2019 16:22:37 +0300 Subject: [PATCH] Fix issues --- examples/vernie/run_away_game.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/vernie/run_away_game.py b/examples/vernie/run_away_game.py index 18fc4a5..27421f9 100644 --- a/examples/vernie/run_away_game.py +++ b/examples/vernie/run_away_game.py @@ -1,5 +1,5 @@ -from pylgbst.constants import COLOR_GREEN, COLOR_NONE -from . import * +from pylgbst.peripherals import COLOR_GREEN, COLOR_NONE +from vernie import * robot = Vernie() running = True @@ -11,7 +11,7 @@ def callback(color, distance): 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, is_async=True) + robot.motor_AB.timed(secs / 1, -speed) robot.say("Ouch") @@ -31,6 +31,3 @@ while running: robot.vision_sensor.unsubscribe(callback) robot.button.unsubscribe(on_btn) -robot.led.set_color(COLOR_NONE) -while robot.led.in_progress(): - time.sleep(1)