pdf-icon

UIFlow Guide

UiFlow1 Blockly

Event

Unit

UiFlow1 Project

Unit Mini TVOC/eCO2

Example

Measure air quality parameters

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

setScreenColor(0x222222)
tvoc_0 = unit.get(unit.TVOC, unit.PORTA)

while True:
  print((str('IAP baseline: ') + str((tvoc_0.get_iaq_baseline()))))
  print((str('TVOC now') + str((tvoc_0.TVOC))))
  print((str('eCO2 now') + str((tvoc_0.eCO2))))
  print((str('H2 now') + str((tvoc_0.H2))))
  print((str('Ethanol now') + str((tvoc_0.Ethanol))))
  wait(0.5)
  wait_ms(2)

API

print(tvoc_0.baseline_TVOC)
  • TVOC Reference Value Function Block
print((str('line eco2:') + str((tvoc_0.baseline_eCO2))))
  • eCO₂ Reference Value Function Block
print((str('eco2:') + str((tvoc_0.eCO2))))
  • Get eCO₂ Value Function Block
print(tvoc_0.Ethanol)
  • Ethanol (Concentration) Value Function Block
print((str('H2:') + str((tvoc_0.H2))))
  • Hydrogen (H₂ Concentration) Value Function Block
print((str('line:') + str((tvoc_0.get_iaq_baseline()))))
  • Indoor Air Quality (IAQ) Reference Value Function Block
print(tvoc_0.TVOC)
  • Get TVOC Value Function Block
On This Page