Skip to main content
Teacher Portal

Play

Part 1 - Step by Step

  1. InstructInstruct each group to plan for their VEXcode project by writing pseudocode. They will create pseudocode to have their Code Base robot and extension to drive in a square. Watch the animation below to see the Code Base move successfully. In the animation below, the Code Base starts in the lower left hand corner of a square, facing upwards. It drives forward along the first side of the square, then turns right, and repeats these two behaviors to drive around the entire square.
    Video file
  2. ModelModel for students how to write out the pseudocode. Pseudocode is a shorthand notation for coding that combines verbal and written descriptions of code. Ensure each group has a piece of paper and pencil to write out their pseudocode.
    • Ask students to define the goal of their project. What do they want their Code Base to do? All students should be able to tell you that the Code Base should move in a square.
    • Model how to be specific in pseudocode. Instead of “Drive forward,” students should be describing exactly how far forward using measurements and units.

    Handwritten pseudocode steps to drive the robot in a square. There are eight steps that read as follows: 1. Robot drives forward for 400mm; 2. Robot turns right for 90 degrees; 3. Robot drives forward for 400mm; 4. Robot turns right for 90 degrees; 5. Robot drives forward for 400mm; 6. Robot turns right for 90 degrees; 7. Robot drives forward for 400 mm; 8. Robot turns right for 90 degrees.
    Pseudocode

     
  3. FacilitateFacilitate a discussion about pseudocode with students as you walk around and assist groups. Ask students:
    • What do you want their project to accomplish?
    • How are you going to break down the intention or goal of the project into short specific statements?
    • Describe characteristics of a square.
      • How many corners does it have?
      • Are the sides all the same length or are they different lengths?
      • How do you know if your pseudocode is describing a square?
    A teacher sits at a table of a small group of students who are handwriting a list of steps, as though writing pseudocode.
    Writing Pseudocode
  4. RemindRemind students to work as a group and listen to each other's ideas. They may need to try more than once to make sure their pseudocode describes the exact behaviors they want from their Code Base. It will take multiple rounds of trying and failing in order to succeed. That is okay!
  5. AskAsk students how planning pseudocode is similar to planning in other parts of their lives. How do they plan what they are going to pack before a trip? Have they ever forgotten something important because they skipped planning? (a shoe, a toy, a charger)

Mid-Play Break & Group Discussion

As soon as every group has finished writing their pseudocode, come together for a brief conversation.

  • How do you think writing this pseudocode prepares you for coding your Code Base robot?
  • Ask groups to describe the specific movements of the Code Base based on their pseudocode.

Part 2 - Step by Step

  1. InstructInstruct students that they will be transferring their pseudocode to code in VEXcode GO, then create a project to have the Code Base drive in a square. They will have three tries to test, revise, and re-test their project on their Code Base. Watch the video below to see the Code Base move successfully. In the animation below, the Code Base starts in the lower left hand corner of a square, facing upwards. It drives forward along the first side of the square, then turns right, and repeats these two behaviors to drive around the entire square.
    Video file
  2. ModelModel for students how to first transfer their pseudocode to [Comment] blocks in VEXcode GO. Then, create and start their project to have the Code Base drive in a square.
    • If students need assistance opening and saving a project, model the steps in the Open and Save a Project article for your device, and have them follow along.
    • Have students name their project Drive in a Square.

    The project name box in the center of the VEXcode GO Toolbar is highlighted with a red box, and reads Drive in a Square.
    Name Project
    • Once students have named their project, students will then need to connect their Code Base to their device. If necessary, model the steps in the Connect a VEX GO Brain VEX Library article for students.
    • They will also need to configure VEXCode GO for the Code Base. Model the steps from the Configure a Code Base VEX Library article and ensure students can see the Drivetrain blocks in the Toolbox.
    • Show how to drag a [Comment] block into the Workspace and place under the {When started} block. If necessary, see the Using Comments in VEXcode GO VEX Library article for information on how to use comments in a project. 

    A VEXcode GO project with a When started block and an attached Comment block.
    Add [Comment] block to {When started}
    • Model adding the first line of pseudocode to the [Comment] block.

    The same project, with the comment filled in to read Drive forward for 400mm.
    Add Pseudocode to [Comment] Block
    • Have students transfer all of their pseudocode to [Comment] blocks. 

    Note: Students will need 1 [Comment] block for each line of pseudocode. So, if they have 8 lines of pseudocode, they will need 8 [Comment] blocks.

    An overview of converting pseudocode to Comment blocks in a project. The handwritten steps of the pseudocode are shown on the left, and a VEXcode GO project on the right shows those steps as a stack of 8 comment blocks attached to the When started block.
    Pseudocode to [Comment] Blocks

    Once students have transferred their pseudocode, they will add Drivetrain blocks. Remind students that the [Comment] blocks are used to organize their projects and they will not execute behaviors. They will need to add Drivetrain blocks to make their Code Base move.  

    • Have students add a [Drive for] block under the first [Comment] block.

    The same VEXcode GO project, with a drive for block being added between the first and second comment blocks.
    Add [Drive for] under first [Comment] block
    • Then, have students adjust the parameters to match what is called for in the [Comment] block. In this case, that is 400 millimeters (mm).
    • Next, have students add a [Turn for] block, and check to make sure the parameters match the pseudocode in the [Comment] block.

    The same VEXcode GO project with a Drive for and Turn for block added after the first and second comments respectively. The start of the project now reads When started, Comment - Drive forward for 400mm; then Drive forward for 400mm; Comment of Turn right for 90 degrees; then Turn right for 90 degrees; then the remaining comments.
    Add [Turn for] block
    • Have students continue until they have added Drivetrain blocks for each of the [Comment] blocks.

      The same project with the necessary Drivetrain blocks added between each Comment. The project alternates between a Comment and the matching block. The project now reads: When started, Comment of Drive forward 400mm; then drive forward for 400mm block; Comment of Turn right for 90 degrees; then Turn right for 90 degrees block. This is repeated four times.
      Drive in a Square Project

       

    • Once students have added all of the Drivetrain blocks, they are ready to start their project. Have students select the ‘Start’ button in the Toolbar to start the project, and observe the movements of the Code Base. If needed, review the steps from the Starting a Project in VEXcode GO VEX Library article, and model the steps to start a project for students.
    • Have students run 3 test trials to test their Drive in a Square project and use the Data Collection sheet to document what worked and what changes need to be made. 
  3. FacilitateFacilitate as students are building their projects by encouraging students to use directional language and reference their pseudocode if they get stuck. As you circle the room helping students, ask questions about their process.
    • What commands are you using to make your Code Base move in a square?
    • Describe your previous trials (if students have already been able to test)
      • What worked in your project?
      • What did not work?
      • How are you going to adjust your project? Is there a specific command you need to change?
    • How can you instruct the Code Base move in a perfect square? Are there any specific commands you need to change?
    Students sit at a table together holding a tablet and smiling and pointing, indicating communicating and collaborating to solve the challenge.
    Collaborating on a project
  4. RemindRemind teams that they have three tries to test, change, and re-test their plan. Their first try will most likely not work. They will need to try more than once to get their Code Base to successfully move in a square. Remind students to record the trials and changes on their Data Collection Sheet as they are testing.
    Data Collection Sheet shows the Lab name as Lab 2: Drive and Apply, with students' names at the top. A Data table with 3 columns across shows the Trial, Summary of the Trial, and Changes to be made. Trial 1 reads Robot did not turn right under the summary; and adjust VEXcode GO command in the changes. Trial 2 reads Robot drove too far forward in the Summary; and Change the length number or the unit of measure in the changes. Trial 3 reads Robot drove in the square as programmed in the summary.
    Example of filled out Data Collection Sheet
  5. AskAsk students if the pseudocode helped them with the challenge in Play Part 2. Planning is a huge part of other jobs too. Can they name jobs where they have to plan ahead? (Engineering, Coding, Teaching, etc).

Optional: Teams may deconstruct their Code Base robot if needed after this point in the experience. They will use the same build in the subsequent labs, so this is a teacher option.