import machine class WaterSensor: def __init__(self, pin): self.waterSensor = machine.ADC(pin) self.threshold = 2000 def isWaterPresent(self): return self.waterSensor.read_u16() > self.threshold