声波传感器
To connect from the MATLAB software to the EV3 Ultrasonic Sensor (item number 45504) use thesonicSensor
function to create asonicSensor
object.
To measure the distance from the sensor to the nearest object, use thereadDistance
function with thetouchSensor
object. The sensor uses ultrasonic sonar to measure the distance to the nearest object, and returns the measurement value in meters.