pdf-icon

UIFlow 上手教程

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 项目配置

Mini Unit BPS v1.1

Example

获取设备测量到的大气温度、湿度和压力

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

setScreenColor(0x222222)
bpsv11_0 = unit.get(unit.BPS_QMP, unit.PORTA)

while True:
  print((str('temperature:') + str((bpsv11_0.temperature))))
  print((str('pressure:') + str((bpsv11_0.pressure))))
  wait_ms(2)

API

print((str('pressure:') + str((bpsv11_0.pressure))))
  • 获取压力值(Pa)
print((str('temperature:') + str((bpsv11_0.temperature))))
  • 获取设备感应到的温度(℃)
On This Page