- :-

Topics Covered

  • Repeat (Loop) Behavior
  • Lesson Links

    Check Your Understanding:
    1. 1. What does the Loop do?
    2. Send the program "flow" back to an earlier point in the program, causing it to repeat some instructions
      Choose between two different possible sets of commands to run
      Repeat a branching decision quickly, to enable continuous control of the robot
      Run all the programs on the robot in a continuous cycle
    3. 2. How do you add a Loop to a program?
    4. Click the Loop Block, then drag a box around the commands you want to put inside the Loop
      Select the blocks you want to put inside the Loop, then right-click and choose "Place in Loop"
      Right-click in an empty area and choose "Make Loop" from the menu that appears
      Drag a Loop Block into the program, then drag commands into it
    Mini Challenge

    Mini Challenge 1: Square Dance 1

    You can use looped behavior to create repeated movement using much fewer command blocks!
    • Place the robot at a corner of a square box or a path
    • Program a Looped behavior that makes the robot travel around a square box forever.
    • Note : Mechanical limitations will prevent the robot from staying on course forever. Complete at least one full lap to complete the challenge!

    What set of movements needs to be repeated in order for the robot to drive in a square path?

    To successfully travel one side of a square box, the robot must travel the length of the box, and then make a 90 degree turn.

    + hint