pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Env

Outputs temperature, humidity, and atmospheric pressure values.

Example

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).
On This Page