Raspberry Pi - Automation and Scheduling
What will be the output of this Python code controlling a pump based on soil moisture sensor reading?
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)
soil_moisture = 300 # sensor value
if soil_moisture < 400:
GPIO.output(17, GPIO.HIGH)
print("Pump ON")
else:
GPIO.output(17, GPIO.LOW)
print("Pump OFF")