add left/right line value
This commit is contained in:
parent
80a6cb7522
commit
b8406b4d94
4
hal.py
4
hal.py
@ -169,12 +169,12 @@ class Sumorobot(object):
|
|||||||
|
|
||||||
# Return the given line sensor value
|
# Return the given line sensor value
|
||||||
if dir == LEFT:
|
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)
|
self.set_led(LEFT_LINE, line)
|
||||||
last_line = LEFT
|
last_line = LEFT
|
||||||
return line
|
return line
|
||||||
elif dir == RIGHT:
|
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)
|
self.set_led(RIGHT_LINE, line)
|
||||||
last_line = RIGHT
|
last_line = RIGHT
|
||||||
return line
|
return line
|
||||||
|
Loading…
Reference in New Issue
Block a user