parent
f45ad8f79c
commit
9cc7a6b366
8
main.py
8
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())
|
||||
print(get_water_level())
|
||||
print(get_moisture())
|
Loading…
Reference in New Issue