pdf-icon

UIFlow Guide

UiFlow1 Blockly

Event

Unit

UiFlow1 Project

Unit Key

Example

Press the button, test the key

from m5stack import *
from m5stack_ui import *
from uiflow import *
import unit

screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)
key_0 = unit.get(unit.KEY, unit.PORTB)

key_0.set_color(0xff0000, 50)
while True:
  if key_0.get_switch_status():
    print((str('status:') + str((key_0.get_switch_status()))))
  wait_ms(2)

API

print((str('status:') + str((key_0.get_switch_status()))))
  • Obtain the status of the key switch
key_0.set_color(0xff0000, 50)
  • Set the color of the keys
key_0.set_color(0xff0000, 50)
  • Set the color of the keys
  • Palette
  • Hex
  • RGB
key_0.set_color(0x000000, 50)
  • Set the RGB color of the keys
On This Page