pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Module Plus

Example

from m5stack import *
from m5ui import *
from uiflow import *
import module

setScreenColor(0x222222)

plus = module.get(module.PLUS)

while True:
  print((str('Encoder: ') + str((plus.get_encode()))))
  print((str('Button: ') + str((plus.get_press()))))
  wait_ms(2)

API

plus.clean_encode()
  • Clears the current encoder value, resetting it to zero.
plus.get_encode()
  • Retrieves the current encoder value. The returned value represents the current position of the encoder.
plus.get_press()
  • Retrieves the press state of the button. The returned value indicates whether the button is currently pressed.
On This Page