Skip to main content
Teacher Portal

Play

Part 1 - Step by Step

  1. InstructInstruct students that they are going to build a project in VEXcode GO to drive the Code Base until it detects an object on the Mars landing area (the Field). The animation below shows how the Code Base will drive forward two spaces towards the obstacle once this project is started.

    Be sure to use light or white-colored objects to represent the "obstacle" on the landing area to ensure the Eye Sensor will detect this object. Students can remove the obstacle once the Code Base drives up to it and stops.

    Video file
  2. ModelModel for students how to build the 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.
    Add [Drive] block
    • Then have students add a [Wait until] block. Next, drag a <Found object> block inside the hexagonal space within the [Wait until] block.

    A continuation of the VEXcode GO blocks project, now with a Wait Until block added after the Drive block. The project now reads When started, drive forward and then wait until eye found an object.
    Add [Wait until] with <Found object>
    • Have students add a [Stop driving] block to have the Code Base stop driving when an object is detected.

    A continuation of the VEXcode GO blocks project, now with a Stop Driving block added after the Wait Until block. The project now reads When started, drive forward and then wait until eye found an object. Lastly, stop driving.
    Add [Stop driving]

    Model for students how to test their project on the Field.

    • First, show them how to place the obstacle and the Code Base on the square with the"X."

    A top-down view of a GO field with a symbol marking the start position and a paper ball as an obstacle. The obstacle is directly above the starting position.
    Place the Obstacle on the Field and the Code Base on the "X"
    • Ensure that the Eye Sensor, located on the front of the robot, is facing the obstacle.

    A top-down view of the GO field with the VR Robot near the paper ball obstacle. The robot is facing the obstacle and a dotted line indicates that the eye sensor can sense the obstacle.
    Eye Sensor faces obstacle
    • 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 project
    • After the project is finished running, students will need to select the “Stop” button in the Toolbar.

    VEXcode GO Toolbar with the Stop button called out in a red box, in between the Step and Share icons.
    Select Stop
    • For groups who finish early and need additional challenges, have them move the obstacle to a new location and test their project again.
  3. FacilitateFacilitate a conversation with students as they test their projects.
    • How does the Code Base robot move in this project? Can you show me with your hands?
    • How did the Code Base know when to stop?
    • How do you know when there is something in front of you?  
    • If you were the Code Base, which of your senses would help you drive until an object?
  4. RemindRemind students that even though this is a small project, they may make mistakes and it may take more than one try to have their project work successfully. In order to encourage students to embrace the mistakes along the way, ask questions such as:
    • What mistake did you make that taught you something?
    • What part of the Lab made you think hard?
    • Was it difficult to line up the Code Base so that the Eye Sensor faced the object? What strategy did you use to line it up?
  5. AskAsk students to name or describe a device or object that they think uses an eye sensor. Ask them if they have heard of a robot vacuum cleaner? Can they describe how the [Drive], [Wait until], and <Found object> commands might work with this device?

Mid-Play Break & Group Discussion

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

  • Project your screen so all students can see the code, or bring students to a central area where they can all see the code on your tablet or computer.
  • Start the Drive Until 1 project and ask students to watch the code as the project runs and describe what they see. Direct students to describe what happens with the highlight feature, and identify that it stays on the [Wait until] block until the Eye Sensor detects an object.
    • How does the green highlight move when we start our project?  
    • Why do you think the green highlight pauses on the [Wait until] block?
    • What do you think the highlight tells us?

Part 2 - Step by Step

  1. InstructInstruct students that they will be adding onto their project so the Code Base signals when the Eye Sensor has detected an obstacle in the Mars landing area. Students will add an LED Bumper Sensor to their robot, then add [Set bumper color] and [Wait] blocks to their project to create a signal effect.

    As they test their projects, they will remove the obstacle when the robot glows. The animation below shows how the Code Base will drive forward two spaces to reach the obstacle once the project is started, and then glow red after reaching it. Once the LED Bumper on the Code Base glows, students will need to remove the obstacle from the Field. This is also shown in the animation.

    Video file
  2. ModelModel for students how to add the LED Bumper sensor to their Code Base.
    • There are many ways that students can add the LED Bumper to the Code Base. Below is one quick and easy way to add it to the top of the Code Base using only 2 Red Pins and the sensor. The LED Bumper Sensor will need to be connected to Port 2 on the GO Brain. 

    The LED Bumper being attached to the top of the GO Code Base Brain with 2 red pins. This sensor will need to be connected to Port 2 on the GO Brain.
    Add LED Bumper Sensor and Connect to Port 2

    Model how to build onto their existing VEXcode GO project and test it on the Field.

    • If students need to open their Drive Until 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 projects to recreate the code in the image below. The new blocks will have the LED Bumper glow red for 3 seconds to signal that it detects an object. The red box indicates the new blocks that need to be added to the project.

      A continuation of the VEXcode GO blocks project, now with 3 new blocks added to to the end to blink the Bumper LED on and off. The project now reads When started, drive forward and then wait until eye found an object. Lastly, stop driving and blink the Bumper LED by setting bumper to red, waiting 3 seconds, then setting bumper to off.
      Add blocks to have the LED Bumper glow
      • The [Set bumper color] block set to red will make the LED Bumper glow red.
      • The [Wait] block waits for a specific amount of time before moving on to the next block.
      • The [Set bumper color] block set to off will stop the glow effect.
    • Once students have built their project, have them name their project as Drive Until 2 and save it to their device. See the Open and Save section of the VEXcode GO VEX Library for device-specific steps to save a VEXcode GO project.
    • Have students place their Code Base on the field to test their project.

    The same top-down view of the GO field from before, with a symbol marking the start position and a paper ball as an obstacle. The obstacle is directly above the starting position.
    Place the Obstacle on the Field and the Code Base on the "X"
    • 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 project
    • After the Code Base drives until it detects the obstacle, the LED Bumper should glow red for 3 seconds to signal that it detects an object. Students should remove the object when the LED Bumper glows green.
    • Tell students that they will need to select the “Stop” button in the Toolbar after they remove the object.

    VEXcode GO Toolbar with the Stop button called out in a red box, in between the Step and Share icons.
    Select Stop
    • If students finish building and testing their projects quickly, have them add additional Drivetrain blocks to their project to have the Code Base return to the start position. Encourage them to experiment with the different paths that the Code Base can take to get back to the starting point. 
  3. FacilitateFacilitate students testing their projects and taking turns on the Field. As students are testing, ask them questions about the Eye Sensor, and how the Code Base will move based on the blocks in their project.
    • How is your Code Base going to signal that it has detected an object? What blocks are you using to accomplish this?
    • How far away from the obstacle is the Code Base when it stops driving? Can you show me with your hands?
    • What blocks in our project tell the Code Base to stop driving?

    Review the Using the VEX GO Sensors and the Coding with the VEX GO LED Bumper articles for information on the LED Bumper to help students who need additional support to understand how the sensors work in their project.

  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, how do scientists explore faraway places?

    Scientists and engineers design different kinds of robots to explore areas that are too far away or too dangerous for humans to investigate. Scientists design rovers to explore Mars, unmanned submarines to investigate the ocean, and even fly drones into active volcanoes to gather data!  

    • How could scientists code a submarine to use eye sensors to explore the ocean?
    • How could scientists use eye sensors on a drone to help explore a volcano? What command would they use to have the drone fly until it is near the volcano walls?
    • What other tasks could scientists code a Mars rover to do with an eye sensor?