- :-

Topics Covered

  • If/Else Block in Loop Block
  • Repeated Decisions
  • Lesson Links

    Note we are testing NOT trying to achieve any badges here.
    RVW Settings Part 1
    - RVW Robot: Clawbot IQ - Obstacle Det.
    - Section: PROGRAM FLOW
    - Field: Turn If Blocked
    - Start point: A
    RVW Settings Part 2
    - RVW Robot: Clawbot IQ - Obstacle Det.
    - Section: PROGRAM FLOW
    - Field: Try It: Loops
    - Start point: A or B
    RVW Settings Part 3
    - RVW Robot: Clawbot IQ - Obstacle Det.
    - Section: PROGRAM FLOW
    - Field: Obstacle Detection
    - Start point: A
    Check Your Understanding:
    1. 1. What happens when you place an If/Else Conditional Block inside a Repeat Forever Loop?
    2. The robot runs in a circle until told to stop.
      The robot makes a decision once, then repeats the result many times.
      The robot makes a decision many times, taking whatever action is appropriate each time.
      You cannot place an If/Else Sstatement Block inside a Repeat Forever Loop.
    Try It!
    Try it! 1

    Smarter Maze Solver

    The program shown in the video above is in its simplest form, so the robot's performance is very limited. Change your code to add new, useful features! Try it!
    RVW Settings
    - RVW Robot: Clawbot IQ - Obstacle Det.
    - Section: PROGRAM FLOW
    - Field: Obstacle Detection
    - Start point: A

    Enhance your program by adding the following features:

      LED Feedback
      • Output green to the Touch LED any time the robot is moving forward.
      • Output red to the Touch LED any time the robot is turning right

      Limited Duration
      • The robot may get stuck. Make the program end after it has performed 10 moves in total.
    What happens?
    Now you can tell when your robot sees an object/wall by observing the color of its LEDs. Additionally, if the robot gets stuck, it will eventually stop since it is programmed to make 10 moves.
    Mini Challenge

    Mini Challenge 1: Tiles Maze

    The program shown in the video above is in its simplest form, so the robot's performance is very limited. Change your code to add new, useful features!
    RVW Settings
    - RVW Robot: Clawbot IQ - Obstacle Det.
    - Section: PROGRAM FLOW
    - Field: Tiled Maze
    - Start point: A
    • Build a maze for the robot, made up of square floor tiles. (If you don't have floor files, use 30 cm squares).
    • Use folders or boxes to make sure the robot can recognize the walls.
    • You may need to adjust the number of times the loop happens, the angle turned and the distance the robot goes forward each time the loop is executed.

    Note: Though it may not look that way,
    the sample maze shown above CAN be solved using only right turns!
    Not sure how? Give this challenge a try, and see what happens!

    And remember to stay patient for your robot.

    Each time the robot decides that there is NO wall or object in front of it, it will have to travel distance that is equivalent to one maze tile.

    + hint