pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Sonic IO

Example

Obtain Sonic IO measurement data collected by ultrasonic

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

setScreenColor(0x222222)
sonic_io_0 = unit.get(unit.SONIC_IO, unit.PORTB)

while True:
  print(sonic_io_0.get_distance(1))
  wait_ms(2)

API

print(sonic_io_0.get_distance(1))
  • Gets the Senic IO measurement data collected by the device Sonic IO and returns a float type
On This Page