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