UIFlow Guide
在主循环中不断更新并打印TMOS PIR传感器检测到的数据,包括运动状态、存在状态、环境温度变化以及物体温度。
from m5stack import *
from m5ui import *
from uiflow import *
import unit
tmos_0 = unit.get(unit.TMOS, unit.PORTA)
while True:
tmos_0.tick_callback()
print(tmos_0.get_data_ready())
print(tmos_0.get_motion_state())
print(tmos_0.get_motion_value())
print(tmos_0.get_presence_state())
print(tmos_0.get_presence_value())
print(tmos_0.get_tamb_shock_state())
print(tmos_0.get_tambient_raw_value())
print(tmos_0.get_temperature_data())
wait_ms(2)
tmos_0.get_data_ready()
tmos_0.get_motion_state()
tmos_0.get_motion_value()
tmos_0.get_presence_state()
tmos_0.get_presence_value()
tmos_0.get_tamb_shock_state()
tmos_0.get_tambient_raw_value()
tmos_0.get_temperature_data()
def tmos_0_ambient_temperature_shock_detect_event(arg):
# global params
pass
tmos_0.set_callback(tmos_0_ambient_temperature_shock_detect_event, tmos_0.AMBIENT_TEMPERATURE_SHOCK_DETECT)
tmos_0.tick_callback()
tmos_0.get_gain_mode()
tmos_0.get_tmos_sensitivity()
tmos_0.get_motion_threshold()
tmos_0.get_motion_hysteresis()
tmos_0.get_presence_threshold()
tmos_0.get_presence_hysteresis()
tmos_0.get_tambient_shock_threshold()
tmos_0.get_tambient_shock_hysteresis()
tmos_0.set_gain_mode(0)
tmos_0.set_tmos_sensitivity(0)
tmos_0.set_motion_threshold(200)
tmos_0.set_motion_hysteresis(0)
tmos_0.set_presence_threshold(200)
tmos_0.set_presence_hysteresis(0)
tmos_0.set_tambient_shock_threshold(200)
tmos_0.set_tambient_shock_hysteresis(0)