9
0
Fork 0

add status led pin nr. to config file

This commit is contained in:
Silver Kuusik 2018-08-30 12:30:21 +02:00
parent b813624e88
commit 4fdd2155fe
2 changed files with 5 additions and 4 deletions

3
config.json Normal file → Executable file
View 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
View File

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