From 9cc7a6b36626a5489f5da67f97cca0c710d13183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Tue, 12 Jul 2022 09:09:10 +0200 Subject: [PATCH] fixxed sensores MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- main.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 8542bd7..b054274 100644 --- a/main.py +++ b/main.py @@ -19,7 +19,8 @@ except ImportError: sys.path.append('./SDL_Adafruit_ADS1x15') import SDL_Adafruit_ADS1x15 -GPIO.setmode(GPIO.BCM) +GPIO.setwarnings(False) +GPIO.setmode(GPIO.BOARD) def debug_print(message: str): now = datetime.now() @@ -64,7 +65,7 @@ def get_water_level(): TimeElapsed = StopTime - startTime distance = (TimeElapsed * 34300) / 2 - return distance + return int(distance) #moisture def signal_handler(signal, frame): @@ -87,4 +88,5 @@ def get_temperature(): return int(bmp280.temperature) print(get_moisture()) -print(get_water_level()) \ No newline at end of file +print(get_water_level()) +print(get_moisture()) \ No newline at end of file