pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Ultrasonic

Example

Obtain Ultrasonic measurement data collected by ultrasonic

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

setScreenColor(0x222222)
Ultrasonic_0 = unit.get(unit.ULTRASONIC, unit.PORTA)

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

API

print(Ultrasonic_0.distance)
  • Gets the ultrasonic measurement data collected by the device Sonic IO and returns a float type
On This Page