From d036a3d3c711cd453248912485758b362e5bb9d0 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Wed, 9 Nov 2022 23:06:52 +0700 Subject: [PATCH] allow disabling collision detection --- kuukar/kuukar_collision.py | 5 +++-- kuukar/kuukar_config.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/kuukar/kuukar_collision.py b/kuukar/kuukar_collision.py index fadddb4..512cd8e 100644 --- a/kuukar/kuukar_collision.py +++ b/kuukar/kuukar_collision.py @@ -1,5 +1,5 @@ from telemetrix_rpi_pico import telemetrix_rpi_pico -from kuukar.kuukar_config import COLLISION_DETECTOR_PIN +from kuukar.kuukar_config import COLLISION_DETECTOR_PIN, COLLISION_ENABLE from kuukar.kuukar_lcd import lcd from kuukar.kuukar_leds import leds @@ -8,7 +8,8 @@ class collision: self.mcu = mcu self.lcd = lcd self.leds = leds - self.mcu.set_pin_mode_digital_input(COLLISION_DETECTOR_PIN, self.collision_handle) + if COLLISION_ENABLE: + self.mcu.set_pin_mode_digital_input(COLLISION_DETECTOR_PIN, self.collision_handle) def collision_handle(self, data): val = data[2] diff --git a/kuukar/kuukar_config.py b/kuukar/kuukar_config.py index 132e9c5..19c9b87 100644 --- a/kuukar/kuukar_config.py +++ b/kuukar/kuukar_config.py @@ -25,6 +25,7 @@ TURN_TIME_FS_90DEG_MS = 3000.0 BEEPER_PIN = 15 COLLISION_DETECTOR_PIN = 16 +COLLISION_ENABLE = True LEDS_DATA_PIN = 17 LEDS_NUM = 15