| ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
|---|
Ultrasonic Sensor
- class UltrasonicSensor(port)
LEGO® MINDSTORMS® EV3 Ultrasonic Sensor.
- Parameters:
port (Port) – Port to which the sensor is connected.
- await distance(silent=False) int: mm
Measures the distance between the sensor and an object using ultrasonic sound waves.
- Parameters:
silent (bool) – Choose
Trueto turn the sensor off after measuring the distance. This reduces interference with other ultrasonic sensors. If you do this too frequently, the sensor can freeze. If this happens, unplug it and plug it back in.- Returns:
Measured distance.
- await presence() bool
Checks for the presence of other ultrasonic sensors by detecting ultrasonic sounds.
If the other ultrasonic sensor is operating in silent mode, you can only detect the presence of that sensor while it is taking a measurement.
- Returns:
Trueif ultrasonic sounds are detected,Falseif not.