MBot – Movement - follow the hand

Tools

1 computer

Step  1 : Choose MBot in devices and connect the mBot to the computer in the programming interface

Use the dedicated button to connect to the mBot

Step  2 : Choose a distance

Define the distance that you want to keep between the mBot and the hand. Let's call this distance "d"

Step  3 : PART 1

Programme the robot so that it moves forward if it's too far and it moves backwards if it's too close. 

Step  4 : PART 2

To make the robot really follow the hand, you have to define the speed value depending on the distance of the hand.

Write your algorithm on a paper and discuss it with your classmates or the teacher.

Step  5 : Write the program on the computer and test it on the robot

Tips:

- Consider separately the case when distance > d and distance < d

- You may use variables

- Think about the different loops / conditions you will have to use.