Case 25 - Distance Detection Alarm

Case 25 - Distance Detection Alarm

Part 1   Objective

After you upload the program, you can detect the distance between mBot Neo and an object with the ultrasonic sensor. When the distance is less than 15cm, CyberPi raises an alarm.

70.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, web version, or mobile app), connect CyberPi, and select the Upload mode.

71.gif
72.gif

Part 3   Programming

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

73.gif

Part 4   Practice

  1. After you learn from the above cases, what else sensors on CyberPi can you use together with the ultrasonic sensor?

 

 

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

Comments

0 comments

Please sign in to leave a comment.