diff --git a/sensors/watersensor.py b/sensors/watersensor.py index 32c25e5..3ea33f7 100644 --- a/sensors/watersensor.py +++ b/sensors/watersensor.py @@ -5,11 +5,7 @@ class WaterSensor: def __init__(self, pin): self.waterSensor = machine.ADC(pin) - self.reading = self.waterSensor.read_u16() self.threshold = 2000 - def takeReading(self): - self.reading = self.waterSensor.read_u16() - def isWaterPresent(self): - return self.reading > self.threshold + return self.waterSensor.read_u16() > self.threshold