UIFlow Guide
from m5stack import *
from m5ui import *
from uiflow import *
import time
import unit
setScreenColor(0x222222)
Watering_0 = unit.get(unit.WATERING, unit.PORTB)
while True:
print((str('Water: ') + str((Watering_0.get_adc_value()))))
if (Watering_0.get_adc_value()) < 1000:
Watering_0.set_pump_status(1)
else:
Watering_0.set_pump_status(0)
wait(0.3)
wait_ms(2)
print(Watering_0.get_adc_value())
Watering_0.set_pump_status(0)
Watering_0.set_pump_status(0)