UIFlow Guide
获取 Unit CO2 采集的大气 CO2 浓度,温度,湿度,大气压强数据
from m5stack import *
from m5ui import *
from uiflow import *
import time
import unit
setScreenColor(0x222222)
co2_0 = unit.get(unit.CO2_SCD40, unit.PORTA)
co2_0.stop_periodic_measurement()
print(co2_0.serial_number())
print(co2_0.get_calibration_enabled())
co2_0.start_periodic_measurement()
wait(1)
while True:
if co2_0.data_isready():
co2_0.read_sensor_measurement()
print((str('data status:') + str((co2_0.data_isready()))))
print((str('CO2:') + str((co2_0.co2))))
print((str('Temperature:') + str((co2_0.temperature))))
wait_ms(25)
wait_ms(2)
co2_0.stop_periodic_measurement()
co2_0.factory_reset()
co2_0.force_calibration(400)
print(co2_0.get_calibration_enabled())
print(co2_0.data_isready())
print(co2_0.get_sensor_altitude())
co2_0.read_sensor_measurement()
print(co2_0.serial_number())
print(co2_0.get_temperature_offset())
co2_0.persist_settings()
co2_0.sleep_mode()
print(co2_0.co2)
co2_0.reinit()
co2_0.self_test()
co2_0.set_ambient_pressure(0)
co2_0.set_calibration_enabled(1)
co2_0.set_sensor_altitude(0)
co2_0.set_temperature_offset(4)
co2_0.start_low_periodic_measurement()
co2_0.start_periodic_measurement()
co2_0.wake_up()