What Is It
The ultrasonic sensor allows us to measure the distance to an object, in centimeters by dault.
How It Works
It is composed of an ultrasonic transmitter and an ultrasonic receiver. The transmitter emits an ultrasonic signal which is reflected back as it reaches the target, whereas the receiver converts the reflected signal into an electric signal.
By measuring the time between transmitting and receiving, the distance to the object is calculated.
The ultrasonic sensor provides a measurement range from 3 to 350 cm, with an accuracy to 2 cm.
Real World Analogy
Codecraft
You can find blocks that control the ultrasonic sensor in the tab Sensing in Codecraft.