L
from m5stack import *
from m5ui import *
from uiflow import *
import hat
import unit
import hat
setScreenColor(0x111111)
pbhub0 = unit.get(unit.PBHUB, unit.PORTA)
hat_pir0 = hat.get(hat.PIR)
label0 = M5TextBox(13, 8, "PIR Hat", lcd.FONT_Default,0xFFFFFF, rotate=0)
label1 = M5TextBox(12, 63, "PbHUB", lcd.FONT_Default,0xFFFFFF, rotate=0)
label2 = M5TextBox(34, 34, "0", lcd.FONT_Default,0xFFFFFF, rotate=0)
label3 = M5TextBox(0, 83, "+Light Unit", lcd.FONT_Default,0xFFFFFF, rotate=0)
label4 = M5TextBox(26, 109, "0", lcd.FONT_Default,0xFFFFFF, rotate=0)
while True:
label2.setText(str(hat_pir0.state))
label4.setText(str(pbhub0.analogRead(0)))
wait(1)
wait_ms(2)