UIFlow Guide
from m5stack import *
from m5ui import *
from uiflow import *
import module
import time
setScreenColor(0x222222)
usb = module.get(module.USBHOST)
usb.max3421e_init(sclk=18, mosi=23, miso=19, cs=5, irq=35)
usb.hid_init()
while True:
usb.hid_poll()
if usb.mouse_button_status(1):
print('mouse button left click')
if usb.mouse_button_status(2):
print('mouse button right click')
if usb.mouse_button_status(4):
print('mouse button center click')
print((str('X:') + str((usb.mouse_cursor_x))))
print((str('Y:') + str((usb.mouse_cursor_y))))
wait(1)
wait_ms(2)
import module
usb = module.get(module.USBHOST)
usb.max3421e_init(sclk=18, mosi=23, miso=19, cs=5, irq=35)
usb.hid_init()
usb.hid_poll()
usb.mouse_button_status(status):
usb.mouse_cursor_x
usb.mouse_cursor_y
usb.write_output_pin(PIN,0)
usb.read_input_pin(PIN)
usb.read_output_pin(PIN)