Value of the ultrasonic sensor

6,507
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

 

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  block
To make the value spoken out by the panda easier to read. Here we use  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