pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

CardKB

案例程序

from m5stack import *
from m5ui import *
from uiflow import *
import time
import unit

setScreenColor(0x222222)
cardkb_0 = unit.get(unit.CARDKB, unit.PORTA)

while True:
  print(cardkb_0.keyData)
  print(cardkb_0.keyString)
  wait(0.1)
  wait_ms(2)

功能说明

print(cardkb_0.keyData)
  • 返回ASIIC数值
print(cardkb_0.isNewKeyPress())
  • 返回字符
print(cardkb_0.keyString)
  • 检测按键,按下返回真
On This Page