Skip to main content

Mars Rover-Exploring Mars Geology
Lab 4 - Planetary Geologist

Teacher Portal

Launch the Engage Section

ACTS is what the teacher will do and ASKS is how the teacher will facilitate.

  1. Have students share their ideas, and help them connect the real actions of the Mars rovers to those they are mimicking with the Code Base. 
  2. Guide students to identifying that while the code to collect the sample may change, the sequence to sort the samples will remain the same. Draw on the experiences from the previous Labs to help students see this pattern. 
  3. Have students share ideas and strategies for building projects that they have used in the past. You may want to draw a sketch of the project as students are explaining, or show them the image of the project from Lab 3 as a reference. 
  4. Highlight for students that the longer a project is, the harder it is to work with. Have them share ideas for strategies they can think of to make it easier. Note any responses that align with the concept of reusing code, or making a [My Block]. 
  5. Get students ready to explore this with you, in their groups.
  1. In Lab 3, we coded our Code Base rovers to sort different colored Disks, like the Mars rover sorts different samples on Mars. In our project, our Disks were all in the same place. Do you think that’s true on Mars? Why or why not? 
  2. The Mars rovers, like Perseverance, need to collect samples from different places. But, when the rover comes back to the Mars base - do the samples get sorted in the same way? Do you think that the sorting process is a pattern we would want to repeat if we collected more samples? Why or why not?
  3. How do you think we could use the sorting sequence that we made using the [If then] blocks in Lab 3, in a project to collect more samples from different places? What would we need to do to build that project? 
  4. That could make a project really long, and hard to work with. I wonder, how do you think we might be able to repeat that pattern in our code, without using so many blocks? How could we break up a project like that to make it easier to work with? 
  5. There is a special kind of block, called a [My Block], that we can make in VEXcode GO, to reuse sequences of code in a project. What did the Code Base do each time it collected a Disk and brought it back to the Mars Base? If we were going to create a project to have the robot collect and sort multiple Disks, what actions would be repeated?

Getting the Students Ready to Build

Let’s learn more about My Blocks in VEXcode GO together!
(If students do not have a pre-built Code Base - Eye + Electromagnet from the previous Lab, allow 10 - 15 minutes for students to build it prior to the Lab activities.) 

Facilitate the Build

  1. InstructInstruct students to join their groups, to get ready to learn about My Blocks in VEXcode GO together! First, the class is going to watch the My Blocks tutorial video in VEXcode GO, then you will build your own [My Block] together.
    • Have students establish the roles they will have in the Lab. Use the Suggested Role Responsibilities slide in the Lab 1 Image Slideshow as a guide for students to complete this sheet. To save time, students can reuse the Roles & Responsibilities sheet from Lab 3, and you can decide which role will be building the [My Block] during Engage.
  2. DistributeDistribute a tablet or computer with VEXcode GO to each group. You may want to project your screen, so you can view the tutorial video in VEXcode GO as a class, and so students can follow along with building the [My Block] more easily.

    image of the VEXcode GO workspace
    Open VEXcode GO

    • Students will collect their robots and Disks after the group instruction is complete.
  3. FacilitateFacilitate students getting VEXcode GO ready in their groups, and viewing the My Blocks tutorial video.

    After watching the tutorial, facilitate a conversation about how [My Blocks] are used with questions such as: 

    • What is a [My Block] used for in a VEXcode GO project? 
      • To use the same sequence of blocks multiple times in a project. 
    • What is one reason you might want to use a [My Block] in your VEXcode GO project? 
      • To break up longer projects to make them easier to work with.
    • Why do you think a [My Block] could make our project to collect multiple Disks easier to work with? 
      • So that we only have to create the sequence to sort the Disks once, then we can reuse it.


    Facilitate building the [My Block] in VEXcode GO.

    • Have students open their Sort All project from Lab 3.
      • If students do not have access to their project from Lab 3, you can share the Sort All - VEXcode GO Blocks File project with students, or download it on student computers or tablets. Then, have students open the file in VEXcode GO. 
      • Or, you can display the project and have students recreate it.
    • Together with your students, identify the sequence of blocks that sort the Disk. This sequence is repeated, no matter where the Disk is located the Field, or what color the Disk is.

    image of the sort pattern called out in the Lab 3 solution (the IF then block sequence)
    Identify the Sort Disk pattern

    • Explain that this sequence of blocks will be used multiple times in our project, so this is the code that we will use in our [My Block]. Now we will follow the steps we saw in the 'My Blocks' tutorial to make our [My Block]. First, select ‘My Blocks’ from the Toolbox. Then, select ‘Make a Block’.

    Select Make a Block button
    Select 'My Blocks' and "Make a Block"

    • Customize your [My Block] by selecting the ‘block name’, and rename it ‘Sort Disk’. Then select ‘OK’ to customize your [My Block].

    image showing how to type in a name for the block
    Customize your [My Block]

    • Now that the [My Block] has been created, the [Define] block will appear. (Drag this to the right of your project, if needed.)
      • Check in with students to make sure that everyone can now see a new hat block, that reads 'define Sort Disks'. Call their attention to the fact that this is a hat block, and like the {When started} hat block, it can only have blocks attached beneath it. The blocks we add to the [Define] block, will be the sequence that we want to reuse in our project.

    Image of the Define Block
    [Define] block

    • Next, drag the sequence of blocks to sort the Disks from the Sort All project, and attach them to the [Define] block. Your project should now look like this, with the sequence of [If then] blocks attached to the [Define] block.

    Image of the project with the Sort Disk sequence attached to the [Define] block
    Drag the Sort Disk sequence to the [Define] block

    • Now that you have "defined" what your robot will do with the [My Block], you will add it to your project. Together with your students, look at the stack of blocks beneath the {When started} block – this is the sequence used to collect the first Disk, and return it to the Mars base. What does the Code Base need to do next? Sort the Disk! Add the [My Block] to your project. 

    Image of adding the My Block to the project
    Add [My Block] to your project

    Facilitate a demonstration for the class to trace the project flow as the Code Base executes your project with the [My Block]. 

    Image of the setup to test with a Code Base and the first Disk
    Setup to test your project

    • Make sure that students can see both the robot and your screen with VEXcode GO, then start the project. As the project runs, have students pay attention to the highlighting of the blocks in the project. Call their attention to when the highlight moves to the [Define] block, and narrate what is happening in the project when that highlight moves from one stack of blocks to the other. You may want to restart the project multiple times or step through the project to slow it down, to help students trace the project flow with the [My Block].
      • Ask questions to help students trace the project flow with you, like: 
        • When will the highlight  "jump" to the [Define] block? What makes you say that?
          • When it reaches the [Sort disk] block, the highlight will move to the [Define] block and run the sequence.
        • Why did the highlight "skip" an [If then] block? What condition was False? Which was True? How did that affect the way the highlight moved? 
          • The highlight will move to the [If then] block where the condition is True. It will skip the [If then] blocks where the condition is False. For example, if the Code Base picked up a Blue Disk, the highlight would skip the [If then] blocks with the red and green conditions and only run the one with the blue condition. 
        • What if our Code Base picked up a different colored Disk? Would the highlight still go to the [Define] block? Why?
          • Yes, the highlight would still go to the [Define] block because the [Sort disk] block will still be executed, no matter what color the Disk is. 


    Facilitate students getting ready to complete the rest of the challenge with their groups.  

  4. OfferOffer positive reinforcement for students who are following directions, taking turns, and paying attention to the process of building and testing the [My Block].
A VEX GO character

Teacher Troubleshooting

Facilitation Strategies

  • Think about how your students will access VEXcode GO. Ensure that the computers or tablets that students will use have access to VEXcode GO. For more information about setting up VEXcode GO, see this VEX Library article.
  • Gather the materials each group needs before class. For this Lab, each group of two students will need a GO Kit, Build instructions, a computer or tablet to access VEXcode GO, and the Red, Blue, and Green Disks from the Kit. Students will also need access to a Field for testing. 
  • If students do not have a pre-built Code Base - Eye + Electromagnet from the previous Lab, allow 10 - 15 minutes for students to build it prior to the Lab activities.

image of the Code Base - Eye + Electromagnet build
Code Base - Eye + Electromagnet

  • Set up your Fields ahead of time, as shown in the image below, to serve as a testing area for the Code Base. Have these spread out around the classroom to allow students ample space to test their projects. In this image, the Disks are shown in place for the challenge in Play. You may want to mark the starting locations of the Disks and the Code Base, as well as the sorting area locations with a dry erase marker to help students when they are setting up to test their projects.

image of the Field setup
Field Setup

  • Write the distances to each Disk on the board for students to reference during the Lab. To keep students focused on the coding concepts during Play, give students the approximate distances to each Disk, so that they are not distracted by measuring. 
    • To collect the Red Disk - 400 mm (~16 inches)
    • To collect the Green Disk - 425 mm (~17 inches), turn, 300 mm (~12 inches)
    • To collect the Blue Disk - 150 mm (~6 inches), turn, 400 mm (~16 inches)
  • Celebrate challenges as well as successes. This Lab is an opportunity for students to apply what they have learned throughout the Unit, and students will have varying levels of difficulty and success. To reinforce the growth mindset and the value of perseverance in coding, celebrate the moments where students are challenged, and showing persistence. Encourage groups to support one another, and share strategies that they have learned to help one another.