Skip to main content
Teacher Portal

Play

Part 1 - Step by Step

  1. InstructInstruct students that they are going to pretend that their Code Base robot is a Mars Rover. They will build a project in VEXcode GO to drive and collect a sample with the Code Base. This animation shows how the Code Base will move in this challenge.
    Video file
  2. ModelModel for students how to build a project in VEXcode GO and test their projects on the Field.

    VEXcode GO blocks project that drives forwards. The project reads When started, drive forward for 100mm.
    Add [Drive for] block
    • Model for students how to change the parameter of the [Drive for] block so the Code Base drives forward to the sample location. Note: 325 millimeters (mm) will drive the Code Base to the sample in the recommended Field setup. 

    A continuation of the VEXcode GO blocks project, now with the driving distance changed from 100mm to 325mm. The project now reads When started, drive forward for 325mm.
    Change parameters
    • Then, have students drag in a [Set bumper color] block to have the Code Base signal that it is collecting a sample. This block will have the LED Bumper glow in the selected color. 

    A continuation of the VEXcode GO blocks project, now with a Set Bumper Color block added after the Drive For block. The project now reads When started, drive forward for 325mm and then set bumper to red.
    Add [Set bumper color] block
    • Next, have students drag in a [Wait] block, and set it to 3 seconds. These three seconds will allow time for the Code Base to "collect the sample."

    A continuation of the VEXcode GO blocks project, now with a Wait 3 seconds block added after the Set Bumper Color block. The project now reads When started, drive forward for 325mm and then set bumper to red. Finally, wait 3 seconds.
    Add [Wait] block and set to 3 seconds
    • Students should then add another [Set bumper color] block and set it to off. This will have the LED Bumper turn off to signal that the sample has been collected.

    A continuation of the VEXcode GO blocks project, now with a Set Bumper Color to off block added after the Wait block. The project now reads When started, drive forward for 325mm and then set bumper to red. Finally, wait 3 seconds and then set bumper to off. The final Set Bumper Color block's color drop down menu is opened, indicating how a user can change the bumper's color.
    Add [Set bumper color] and set to off

    A top-down view of a GO field with two symbols marking a start position and an object's position. The object is directly above the starting position, and the goal is to reach the object from the starting position.
    Lab 1 Field Setup
    • Once the Code Base is placed on the Field, have students select Start in VEXcode GO to test their projects.

    VEXcode GO Toolbar with the Start button called out in a red box, in between the Brain and Step icons.
    Select Start to test the Collect 1 project
    • After the Code Base drives 325 mm to the collection location, the LED Bumper will glow red to indicate that it is collecting a sample. Students should place their “sample” item on top of the Code Base. After three seconds the LED will turn off to indicate that it is done collecting the sample.
    • For groups who finish early and need additional challenges, have them add a [Turn for] block to the end of their project and test it to see what the Code Base will do. Ask them to experiment, and think of ways that this block could be useful in collecting samples on the Field.
  3. FacilitateFacilitate students working with VEXcode GO and testing their projects. While students are testing their projects, ask questions to help them think about the way their Code Bases are moving.
    • Can you show me, using your hands, how your Code Base is going to move to collect the “sample”?
    • How do you think your Code Base might move next if it was going to go back to the base?
  4. RemindRemind students that they can edit their projects, and retest them if their Code Base doesn’t get to the “sample” location the first time. Students should check the parameter in the [Drive for] block to make sure it has the correct distance needed to reach the sample.
  5. AskAsk students about what kinds of things they think the Mars rover is collecting on its missions. If they were scientists studying Mars, what would they want to learn about?

Mid-Play Break & Group Discussion

As soon as every group has collected the sample, come together for a brief conversation.

  • Now that we’ve collected our sample what do you think our robot needs to do with it?
  • How do you think we can code our Code Base to bring it back to the base? How will the robot need to move to deliver the sample to the base?
  • What blocks do you think we might need to use in the next part of our project to do that?

Part 2 - Step by Step

  1. InstructInstruct students that they will be adding onto their project so the Code Base drives the “sample” back to the base. This animation below shows the Code Base driving to collect the “sample,” then return to the base to deliver the “sample.”
    Video file
  2. ModelModel for students how to build onto their existing VEXcode GO project and test it on the Field.
    • Your students may be able to build a project to complete the challenge on their own. However, for younger students, you may want to build the project together as a class, as you did in Play Part 1. If you are building the project together, you can follow the steps below. 
    • If students need to open their Collect 1 project, model the device-specific steps, as shown in the VEX Library articles in the Open and Save section.
    • Have students add blocks to their VEXcode GO project to recreate the code in the image below. The red box indicates new blocks that need to be added to the project.

    A continuation of the VEXcode GO blocks project, now with 5 new blocks at the end to drive back to the starting position and light up red for 3 seconds. The project now reads When started, drive forward for 325mm and then set bumper to red. Next, wait 3 seconds and then set bumper to off before turning right for 180 degrees. Next drive forward for 325mm, set bumper to red, wait 3 seconds and finally set bumper to off.
    Add blocks to have the Code Base Return- Collect Return project
    • If students have not used the [Turn for] block in a previous project, model how to drag the [Turn for] block into the project and change the parameter to 180 degrees. The turn distance is set to 180 degrees so that the Code Base turns around to face the base before driving forward to deliver the sample. 

    VEXcode GO Turn For block that reads 'turn right for 180 degrees'.
    [Turn for] block set to 180 degrees

    VEXcode GO Toolbar with the Start button called out in a red box, in between the Brain and Step icons.
    Select Start to test the project
    • After the Code Base drives to the collection location, students should place their “sample” item on top of the robot when the LED Bumper glows red. The Code Base will then turn right 180 degrees and drive back to the base. After the robot returns to the base and the LED Bumper glows red, students should remove the “sample” from the Code Base. The LED Bumper will turn off to symbolize that the sample has been delivered.
    • If students finish collecting and delivering the sample and have additional time, encourage them to try navigating to a different sample location. Use a dry erase marker to mark a sample location that is one step closer or further from the base, and have students adjust the parameters of their project to reach this new sample and deliver it to the base.
  3. FacilitateFacilitate students testing their projects and taking turns on the Field. As students are testing, ask them about the sequence of blocks in their project that enables the Code Base to move to the correct place.
    • Can you show me, with your hands, how the Code Base would move if the [Turn for] block was set to left instead of right?
    • What would happen if the turning part of the project came before the driving part? Would your Code Base be able to reach the sample?

    Review the Using the VEX GO Sensors and the Coding with the VEX GO LED Bumper articles for additional information on the LED Bumper.

  4. RemindRemind students that they should check their project and compare it to the image of the project, before testing. If one student built the project in VEXcode GO, their partner can check the code, before placing the Code Base on the Field and starting the project.
  5. AskAsk students about how many samples they think the scientists are trying to collect to study Mars. Why would more samples be more helpful than fewer samples? Do you think our Code Bases could collect multiple samples?