9
0
Fork 0

add left/right line value

This commit is contained in:
Silver Kuusik 2018-12-27 08:54:28 +01:00 committed by GitHub
parent 80a6cb7522
commit b8406b4d94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

4
hal.py
View File

@ -169,12 +169,12 @@ class Sumorobot(object):
# Return the given line sensor value
if dir == LEFT:
line = abs(self.get_line(LEFT) - self.config["left_line_threshold"]) > 1000
line = abs(self.get_line(LEFT) - self.config["left_line_value"]) > self.config["left_line_threshold"]
self.set_led(LEFT_LINE, line)
last_line = LEFT
return line
elif dir == RIGHT:
line = abs(self.get_line(RIGHT) - self.config["right_line_threshold"]) > 1000
line = abs(self.get_line(RIGHT) - self.config["right_line_value"]) > self.config["right_line_threshold"]
self.set_led(RIGHT_LINE, line)
last_line = RIGHT
return line