From 8899b8ebd74200856b6dabe712ee4e3e4ae34513 Mon Sep 17 00:00:00 2001 From: is-qian Date: Fri, 25 Oct 2024 17:12:22 +0800 Subject: [PATCH] grove_water_sensor:Fixing detection logic. --- grove/grove_water_sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grove/grove_water_sensor.py b/grove/grove_water_sensor.py index 9314dd1..bfdac75 100644 --- a/grove/grove_water_sensor.py +++ b/grove/grove_water_sensor.py @@ -70,7 +70,7 @@ def main(): print('Detecting ...') while True: value = sensor.value - if sensor.value > 800: + if sensor.value < 200: print("{}, Detected Water.".format(value)) else: print("{}, Dry.".format(value))