pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Ultrasonic

案例程序

获取Ultrasonic采集的超声波测量数据

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

setScreenColor(0x222222)
Ultrasonic_0 = unit.get(unit.ULTRASONIC, unit.PORTA)

while True:
  print(Ultrasonic_0.distance)
  wait_ms(2)

功能说明

print(Ultrasonic_0.distance)
  • 获得设备 Ultrasonic 采集的超声波测量数据,返回一个 float 类型
On This Page