Case 20 - Detecting Robot (II)

Part 1   Objective

Write a program to make the Detecting Robot follow the movements of your palm.


Part 2   Preparation

  • Mechanical parts and electronic modules of Detecting Robot

  • USB cable (Type-B) x 1

  • Computer with network access x 1

Follow the building steps to build a Detecting Robot. Install the MegaPi encoder/DC motor drivers on MegaPi, connect the motors to the motor ports on MegaPi by using the motor cables, connect MegaPi to the computer by using the USB cable, open mBlock 5 (PC client or web version), click +add, select Ultimate 2.0 from the Device Library, click Connect, and select the Upload mode.


Part 3   Programming

Use the ultrasonic sensor to make the Detecting Robot move forward when your palm is more than 10 cm away from the robot and move backward when your palm is less than 10 cm away from it, looking like it follows the movements of your palm.


Part 4   Practice

Take your robot pet to travel around.

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



Please sign in to leave a comment.