Case 24 - Distance Detection with Ultrasonic Sensor

Case 24 - Distance Detection with Ultrasonic Sensor

Part 1   Objective

After you upload the program, you can detect distance (at a range of 5~300cm) with the ultrasonic sensor.

66.gif

Part 2   Preparation

  • CyberPi-installed shield x 1 (powered on)

  • Installed ultrasonic sensor

  • USB cable (Type-C) x 1

  • Computer with network access x 1

Assemble the above parts, connect CyberPi to the computer by using the cable, open mBlock 5 (PC client or web version), connect CyberPi, and select the Upload mode.

67.gif
68.gif

Part 3   Programming

  1. Add Ultrasonic Sensor 2, and then program with the blocks added.

69.gif

Part 4   Practice

  1. You can set funny ambient light in ultrasonic sensor. Set it now.

 

 

Was this article helpful?
1 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.