pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Unit Laser Tx

案例程序

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

setScreenColor(0x222222)
laser_rx_0 = unit.get(unit.LASERRX, unit.PORTB)
laser_tx_0 = unit.get(unit.LASERTX, unit.PORTB)

while True:
  if btnA.wasPressed():
    laser_tx_0.on()
  elif btnB.wasPressed():
    laser_tx_0.off()
  wait_ms(2)

功能说明

laser_tx_0.off()
  • 禁用Unit Laser Tx
laser_tx_0.on()
  • 启动Unit Laser Tx
On This Page