pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Unit ToF

Example

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
On This Page