What is the Ultrasonic sensor ?
Ultrasonic sensor is a device that can measure the distance to an object by using sound waves
How does it work?
It measures distance by sending out a sound wave at a specific frequency and listening for that sound wave to bounce back. By recording the elapsed time between the sound wave being generated and the sound wave bouncing back, it is possible to calculate the distance between the sonar sensor and the object.
How to connect it ?
The Ultrasonic sensor has four pins as follow:
You can connect it to the board directly using plug and play connectors to B1 or B2
How to program it ?
here is an example code