pdf-icon

UIFlow Guide

UiFlow1 Blockly

Event

Unit

UiFlow1 Project

Unit Ultrasonic-IO

Example

Obtain Sonic IO 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)
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
Example
API
Q&A
Submit a question
Select question category*
Arduino
MicroPython
UIFlow1
UIFlow2
EzData
M5Burner
Software
Hardware
Other
Product name
Product version
Question description*
(Supports pasting screenshots.)
Attachments
Add Files
Email*
Submit
OK

M5Stack Support

Hi, this is M5Stack Support. How can I help you today?