- :-

Topics Covered

  • Ultrasonic Sensor
  • Thresholds
  • Forward Until Behavior
  • Lesson Links

    Check Your Understanding:
    1. 1. If the robot is facing a wall, it will move until...
    2. The Ultrasonic Sensor has traveled 50 cm
      The Ultrasonic Sensor is 50 cm from the wall
      The robot moves 50 cm total
      The robot detects an obstacle beyond 50 cm away
    Mini Challenge

    Mini Challenge 1: 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.

    • Place the robot near a wall or object, facing it.
    • Program the robot to back away from it until it is 30 cm away.

    Remember that negative motor power makes the robot move backwards

    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.

    + hint