Exercice : Mini Challenge

Mini Challenge 5: Backward Until Far

The program above is Forward Until Near, meaning the robot will move forward until it detects a wall or object within the set threshold. Now, perform the opposite. Create a program that makes the robot make backwards from a wall or object until it is beyond the set threshold.

Question

  1. Place the robot near a wall or object, facing it.

  2. Program the robot to back away from it until it is 30 cm away.

Indice

Hint 1: Remember that negative motor power makes the robot move backwards.

Indice

Hint 2: The distance will start below the threshold (CLOSER than 30 cm). You will need to back up until the distance is GREATER THAN the threshold.