pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Yun

案例程序

设置灯的颜色为红色,并获取传感器的温湿度和大气压力数值

from m5stack import *
from m5ui import *
from uiflow import *
import hat

setScreenColor(0x111111)

hat_yun_0 = hat.get(hat.YUN)

hat_yun_0.SetRGBAll(0xff0000)
while True:
  print(hat_yun_0.temperature)
  print(hat_yun_0.humidity)
  print(hat_yun_0.pressure)
  wait_ms(2)

功能说明


  • uiflow_block_get_hat_yun_brightness

  • uiflow_block_get_hat_yun_humidity

  • uiflow_block_get_hat_yun_pressure

  • uiflow_block_get_hat_yun_temperature

  • uiflow_block_yun_hat_set_color

  • uiflow_block_yun_hat_set_color_all
On This Page