Value of the ultrasonic sensor

12,368
Author: Yisong Xu, Si Xu

Display on the stage the value of the external ultrasonic sensor in the manner of a panda saying.

Hardware requirements:

mBot

Implementation:

Online debugging (serial/Bluetooth connection)

Example program download:

Value of the ultrasonic sensor.sb2

download

Example programs
kids programming language

 

Script description
Please refer to Example 11 Value of the light sensor.

 

Knowledge point
Point 1 Ultrasonic sensor introduction
An ultrasonic sensor is like the eyes of mBot, which can let mBot know the distance from an object in front. The ultrasonic sensor measures in cm with preciseness to 1cm and maximum measurable distance to 400cm.

Point 2 Why use kids programming language block
To make the value spoken out by the panda easier to read. Here we use kids programming language block to show the value. If we do not use the block, you will find the reads on the stage unstable.

 

Attachedultrasonic sensor element diagram

kids programming language