pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Atom Printer

功能说明
Atom Printer的默认固件在配置Wi-Fi连接后将自动连接至服务器, 其他设备在UIFlow中可以通过使用Atom Printer Block, 通过配置与设备一致的token, 来实现远程打印控制。

案例程序

from m5stack import *
from m5ui import *
from uiflow import *
from MediaTrans.Mqtt_Printer import Mqtt_Printer

setScreenColor(0x222222)
def buttonA_wasPressed():
  # global params
  mqtt.text_print('Hello', 10, 0)
  pass
btnA.wasPressed(buttonA_wasPressed)


mqtt = Mqtt_Printer('94:B9:7E:AC:41:81')
mqtt.start()

功能说明

from MediaTrans.Mqtt_Printer import Mqtt_Printer
mqtt = Mqtt_Printer('94:B9:7E:AC:41:81')
mqtt.start()
  • 设置Atom Printer设备的Topic(Mac地址)
mqtt.text_print('Hai', 10, 0)
  • 控制打印文本信息, 并设置打印坐标位置。
mqtt.bar_print('1234')
  • 控制打印BarCode
mqtt.qr_print('1234')
  • 控制打印QRCode
On This Page