From 4fdd2155fee66bfb6c7fe895668d9129e58aee63 Mon Sep 17 00:00:00 2001 From: Silver Kuusik Date: Thu, 30 Aug 2018 12:30:21 +0200 Subject: [PATCH] add status led pin nr. to config file --- config.json | 3 ++- hal.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) mode change 100644 => 100755 config.json diff --git a/config.json b/config.json old mode 100644 new mode 100755 index 42165d9..ec5bdfb --- a/config.json +++ b/config.json @@ -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": { diff --git a/hal.py b/hal.py index 26026f6..6d3262e 100755 --- a/hal.py +++ b/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: