1
0
mirror of https://github.com/undera/pylgbst.git synced 2020-11-18 19:37:26 -08:00

Remove non-working thing

This commit is contained in:
Andrey Pohilko 2017-09-16 21:24:55 +03:00
parent 8f65d1553a
commit b2a83f6438

View File

@ -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):