Skip to main content

The Builder in each group should get the hardware required. The Recorder should get the group's engineering notebook. The Programmer should open VEXcode IQ.

Materials Required:
Quantity Materials Needed
1

VEX IQ Super Kit

1

VEXcode IQ

1

Engineering Notebook

1

Using Loops (Tutorial)

1

Repeating Actions example project

This activity will give you the tools to program your robot with repeating behaviors. 

You can use the Help information inside of VEXcode IQ to learn about the blocks. For guidance in using the Help feature, see the Using Help tutorial.image of the Tutorials icon in the Toolbar in VEXcode IQ

Step 1: Preparing for the activity

Before you begin the activity, do you have each of these items ready? The Builder should check each of the following:

Step 2: Let's start programming with loops.

Start by watching the Using Loops Tutorial video in VEXcode IQ. image of the Using Loops tutorial video icon in VEXcode IQ

VEXcode IQ contains many different example projects. You’ll use one of them in this exploration. For help and tips on using example projects, check out the Using Examples and Templates tutorial.Image of the Using example projects and templates icon in tutorial videos in VEXcode IQ

Then, open the Repeating Actions example project. Image of the open examples option in the File menu in VEXcode IQ

The Programmer should complete the following steps: 

  • Open the File menu.
  • Select Open Examples
  • Use the filter bar at the top of the application and select 'Control'. image of the repeating actions example project icon within the example project menu
  • Select and open the Repeating Actions example project.image of the repeating actions example project icon in VEXcode IQ
  • Save your project as 'Repeating Actions'. image of the repeating actions file name in the Toolbar in VEXcode IQ
  • Check to make sure the project name 'Repeating Actions' is now in the window in the center of the Toolbar. 

What is this project actually doing? image of the example project as it appears in VEXcode IQ

Do the following in your engineering notebook: 

Predict what the project will have the Clawbot do. Explain each and every action that the robot will complete. 

Step 3: What is the difference between [Forever] and [Repeat]?

Image of two projects side by side, one with a forever loop and one with a repeat loop

  • Look over the Repeating Actions example project again. It's also the stack of blocks shown on the right above.
    Notice that the [Repeat] block only has the movements repeating 4 times. Repetitive movements rarely need to repeat forever so a [Repeat] block is used when only a certain number of repetitions is needed.

    If the [Repeat] block was replaced with the [Forever] block, the robot would just repeat in a square forever.

  • A [Forever] block is often used with a conditional statement in order to continuously check to see if the condition is true. In the stack of blocks above attached to the [Forever] block, notice how the robot will drive forward until it meets the condition of bumping into something with the bumper switch. If the bumper switch is pressed, the robot will turn. Otherwise, it will continue driving forward.

    This is a practical use-case of the [Forever] block. Imagine a self-driving sweeper that continues to drive forward until it runs into something, then it turns.

Step 4: The Stop and Go Challenge!

image of the path of the robot

  • Have your Clawbot drive in a square. 
  • Before each turn: 
    • The claw must be opened and closed.
    • The arm must be raised and lowered.
    • The Touch LED must show at least one color. 
    • At least one sound must play. 
  • The Clawbot cannot drive along a side of the square more than once. 
  • You can use the Repeating Actions example project as a starting point but save it as StopAndGo before making any changes.image of the stop and go file name in the Toolbar in VEXcode IQ

In your engineering notebook, plan the following:

  • Have the Driver and Recorder plan out your solution and predict what each block in your project will have the Clawbot do.

  • Have the Programmer Download and run your project to test it before submitting it.

  • Have the Builder make changes to the project as needed and communicate with the Recorder to take notes about what was changed during testing.