add status led pin nr. to config file
This commit is contained in:
parent
b813624e88
commit
4fdd2155fe
3
config.json
Normal file → Executable file
3
config.json
Normal file → Executable file
@ -1,9 +1,10 @@
|
||||
{
|
||||
"status_led": 22,
|
||||
"battery_coeff": 2.25,
|
||||
"left_servo_tuning": 33,
|
||||
"right_servo_tuning": 33,
|
||||
"blockly_highlight": true,
|
||||
"ultrasonic_distance": 60,
|
||||
"ultrasonic_distance": 40,
|
||||
"left_line_threshold": 1000,
|
||||
"right_line_threshold": 1000,
|
||||
"wifis": {
|
||||
|
6
hal.py
6
hal.py
@ -32,7 +32,7 @@ class Sumorobot(object):
|
||||
self.pwm_right = PWM(Pin(4), freq=50, duty=0)
|
||||
|
||||
# Bottom status LED
|
||||
self.status_led = Pin(5, Pin.OUT)
|
||||
self.status_led = Pin(self.config["status_led"], Pin.OUT)
|
||||
# Bottom status LED is in reverse polarity
|
||||
self.status_led.value(1)
|
||||
# Sensor LEDs
|
||||
@ -223,9 +223,9 @@ class Sumorobot(object):
|
||||
self.search_counter = 0
|
||||
# When to search
|
||||
if self.search:
|
||||
self.move(FORWARD, block_id)
|
||||
self.move(FORWARD)
|
||||
else:
|
||||
self.move(LEFT, block_id)
|
||||
self.move(LEFT)
|
||||
# Increase search counter
|
||||
self.search_counter += 1
|
||||
elif dir == FORWARD:
|
||||
|
Loading…
Reference in New Issue
Block a user