pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Unit Digi Clock

案例程序

数码管显示字符A

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

setScreenColor(0x222222)
digi_clock_0 = unit.get(unit.DIGI_CLOCK, unit.PORTA)

digi_clock_0.init_i2c_address(0x30)
digi_clock_0.write_brightness(4)
while True:
  digi_clock_0.write_char('A',0)
  wait(1)
  digi_clock_0.clear()
  wait(1)
  wait_ms(2)

功能说明

igi_clock_0.init_i2c_address(0x30)
  • 初始化I2C地址
digi_clock_0.clear()
  • 清除数码屏幕显示数据
print(digi_clock_0.read_version())
  • 获取Unit 版本
digi_clock_0.write_brightness(0)
  • 设置屏幕亮度
digi_clock_0.write_char('',0)
  • 对指定index数码管显示字符
digi_clock_0.write_char_list('')
  • 对指定index数码管显示字符串
digi_clock_0.write_match_string('')
  • 数码管显示数值字符串。如"12356"
digi_clock_0.write_raw(0,0)
  • 对指定数码管写入原始数据
On This Page