English
English
简体中文
日本語

UiFlow Tutorial

UiFlow1 Development Guide

Project Management

Use LTE network

UiFlow1 Blockly

Event

Unit

Hat ENV

Example

Outputs temperature, humidity, and atmospheric pressure values.

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

setScreenColor(0x111111)

hat_env_0 = hat.get(hat.ENV)

while True:
  print(hat_env_0.pressure)
  print(hat_env_0.temperature)
  print(hat_env_0.humidity)
  wait_ms(2)

API

hat_env_0.humidity
  • Retrieves the ambient humidity as a floating-point percentage.
hat_env_0.temperature
  • Retrieves the ambient temperature as a floating-point value in degrees Celsius.
hat_env_0.pressure
  • Retrieves the ambient pressure as a floating-point value in hPa (hectopascals).
Page Tools
PDF
On This Page