UIFlow Guide
Continuously prints the joystick's X and Y axis values and button press state in the serial output.
from m5stack import *
from m5ui import *
from uiflow import *
import hat
setScreenColor(0x111111)
hat_Joystick_0 = hat.get(hat.JOYSTICK)
while True:
print(hat_Joystick_0.X)
print(hat_Joystick_0.Y)
print(hat_Joystick_0.Press)
wait_ms(2)
hat_Joystick_0.Press
hat_Joystick_0.InvertX
hat_Joystick_0.InvertY
hat_Joystick_0.X
hat_Joystick_0.Y