UIFlow Guide
Anchor 模式,用于固定作为锚点
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
uwb_0 = unit.get(unit.UWB, unit.PORTC)
uwb_0.init_uwb_mode(0)
uwb_0.set_mode(0)
while True:
if uwb_0.check_device:
print((str('distance') + str((uwb_0.device_id))))
wait_ms(2)
Tag 模式,移动点,获取定位
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
uwb_0 = unit.get(unit.UWB, unit.PORTC)
uwb_0.init_uwb_mode()
uwb_0.set_mode()
while True:
if uwb_0.check_device:
print((str('distance') + str((uwb_0.get_distance_measure[0]))))
wait_ms(2)
uwb_0.init_uwb_mode()
uwb_0.uart_port_id(1)
print(uwb_0.check_device)
uwb_0.continuous_output_value(0)
print(uwb_0.device_id)
print(uwb_0.get_distance_measure[0])
print(uwb_0.get_version())
uwb_0.set_mode(0)
uwb_0.set_range_interval(5)
uwb_0.set_mode()
uwb_0.update_new_value_loop()