
UiFlow Tutorial
Outputs the light intensity value via serial.
from m5stack import *
from m5ui import *
from uiflow import *
import hat
setScreenColor(0x111111)
hat_dlight_0 = hat.get(hat.DLIGHT)
hat_dlight_0.set_mode(0x10)
while True:
print(hat_dlight_0.get_lux())
wait_ms(2) hat_dlight_0.get_lux() hat_dlight_0.set_mode(0x10) hat_dlight_0.set_mode(0x20) hat_dlight_0.set_mode(0x00)