English
English
简体中文
日本語

UiFlow Tutorial

UiFlow1 Development Guide

Project Management

Use LTE network

UiFlow1 Blockly

Event

Unit

Unit ToF

Example

Get the distance data measured by the device

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

setScreenColor(0x222222)
tof_0 = unit.get(unit.TOF, unit.PORTA)

while True:
  print(tof_0.distance)
  wait_ms(2)

API

print(tof_0.distance)
  • Gets the distance measured by the Unit ToF
Page Tools
PDF
On This Page