pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Unit Digi Clock

Example

Numeral display character 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)

API

igi_clock_0.init_i2c_address(0x30)
  • Initialize I2C address
digi_clock_0.clear()
  • Clear display data on digital screen
print(digi_clock_0.read_version())
  • Retrieve Unit version
digi_clock_0.write_brightness(0)
  • Set screen brightness
digi_clock_0.write_char('',0)
  • Display a character on a specific index of the digital tube
digi_clock_0.write_char_list('')
  • Display a string on a specific index of the digital tube
digi_clock_0.write_match_string('')
  • Display a numeric string on the digital tubes. For example, "12356"
digi_clock_0.write_raw(0,0)
  • Write raw data to a specified digital tube
On This Page