Play
Part 1 - Step by Step
- 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 - ModelModel for students how to build the project in VEXcode GO and test their projects on the Field.
- Begin by showing students how to connect the Brain on their Code Base to their device in VEXcode GO. Because connection steps vary between devices, see the Connecting articles of the VEXcode GO VEX Library for specific steps to connect the VEX GO Brain to your computer or tablet.
- They will also need to configure VEXCode GO for the Code Base. If necessary, model the steps from the Configure a Code Base VEX Library article and ensure students can see the Drivetrain blocks in the Toolbox.
- Drag a [Drive] block into the workspace and attach it to the {When started} block.
- Then have students add a [Wait until] block. Next, drag a <Found object> block inside the hexagonal space within the [Wait until] block.
- Have students add a [Stop driving] block to have the Code Base stop driving when an object is detected.
- Once students have built their project, have them name their project as Drive Until 1 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.
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."
- Ensure that the Eye Sensor, located on the front of the robot, is facing the obstacle.
- Once the Code Base is placed on the Field, have students select ‘Start’ in VEXcode GO to test their projects.
- After the project is finished running, students will need to select the “Stop” button in the Toolbar.
- For groups who finish early and need additional challenges, have them move the obstacle to a new location and test their project again.
- 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?
- 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?
- 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
- 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 - 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.
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.
- 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.
- Once the Code Base is placed on the Field, have students select ‘Start’ in VEXcode GO to test their projects.
- 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.
- 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.
- 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.
- 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.
- 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?