sonicSensor
Connection to ultrasonic sensor
Add-On Required: This feature requires the MATLAB Support Package for LEGO MINDSTORMS EV3 Hardware add-on.
Description
This object represents a connection to an EV3 Ultrasonic Sensor (item number
45504). To measure the distance from the sensor to an object in meters, use this object
with the readDistance
function.
Creation
Description
creates a connection to an ultrasonic sensor. You can use this connection with
the mysonicsensor
= sonicSensor(myev3
)readDistance
function to measure the distance from an
ultrasonic sensor to an object.
If multiple ultrasonic sensors are attached to the EV3 brick, this function chooses the sensor that is attached to the EV3 input port with the lowest number.
creates a connection to an ultrasonic sensor that uses a specific EV3 input port
defined by the InputPort property.mysonicsensor
= sonicSensor(myev3
,inputport)
Input Arguments
Output Arguments
Properties
Object Functions
readDistance | Read distance from ultrasonic sensor to object |