- :-

Topics Covered

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

    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!

    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.