Description
Sonar:bit is an ultrasonic module with a 3-5V working voltage. It is available to be used in a 3.3V or 5V microcontroller system. With only one 3-wire(GVS) cable, it can work properly. Compared to the normal 4-wire ultrasonic module, it has saved one IO port. The measurement range of sonar:bit is 4cm-400cm. It can output stable and accurate measurement data with ±1cm tolerance only. You can use this module for occasions like short-distance measurement, smart cars, robots, micro:bit and Arduino teaching, etc.
Features
Input voltage: 3V~5V
Enable to drive micro:bit or Arduino directly.
Standard 3-wire GVS connector, which occupies 1 IO port only.
Result
We can see the distance between sonar:bit and the object is displayed on micro:bit in real-time. The unit is centimeters.
Aooπlication
Click to open Makecode online editor.
Write your program to assign the returned value of P2 to variable distance and display it on micro:bit screen.
You can see the whole program from the link