fixxed sensores

Signed-off-by: Ebbe Baß <ebbe@ping-mee.de>
master
Ebbe Baß 2022-07-12 09:09:10 +02:00
parent f45ad8f79c
commit 9cc7a6b366
1 changed files with 5 additions and 3 deletions

View File

@ -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())
print(get_water_level())
print(get_moisture())