pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Atomic QRCode

Example

from m5stack import *
from m5ui import *
from uiflow import *
from base.QRCode import QRCode

scan_data = None

qr = QRCode()
while True:
  if btnA.isPressed():
    qr.trigger(0)
  else:
    qr.trigger(1)
  if qr.status():
    scan_data = qr.read()
    if scan_data != None:
      print(scan_data)
  wait_ms(2)

API

from base.QRCode import QRCode
qr = QRCode()
  • Initialize Atomic QRCode.
qr.trigger(control)
  • QRCode scan control:
    • ON: 0
    • OFF: 1
qr.status()
  • QRCode scan status:
    • True: Scan successful
    • False: No content scanned
qr.read()
  • Read the scanned result as a string.
On This Page