Play
Part 1 - Step by Step
- InstructInstruct students that they are going to be challenged to create a project to have the 123 Robot detect all the obstacles in the Mars Landing area. They will be encouraged to build onto their project from Lab 1.
The following animation shows one possible way that the 123 Robot could be coded for the Clear the Landing Area Challenge. In this animation, the robot begins in the bottom row of the Field facing the first obstacle. It then drives forward until an object is detected, then glows green for 2 seconds and turns right. It repeats these behaviors to detect several obstacles on the Field. You will notice that the 123 Robot does not clear every obstacle on the landing area. How could the project be revised to have the 123 Robot rover clear the entire landing area?
Video file - ModelModel for students how to build and test a project in VEXcode 123.
- Have students add blocks and change parameters as they have learned in other Labs to have the 123 Robot clear all the obstacles in the Field.
- Have students rename their project as Clear Area and save it to their device. See the Open and Save section of the VEXcode 123 VEX Library for device-specific steps to save a VEXcode 123 project.
- If necessary, model for students how to test their project on the Field.
-
Show them how to place the 123 Robot on the starting point marked with the "X."
123 Field setup -
Ensure that the Eye Sensor, located on the front of the robot, is facing the first obstacle.
Eye Sensor faces object) -
Place the 123 Robot on the Field and select ‘Start’ in VEXcode 123 to test their projects.
Select "Start" to test the project - Remind students that they will need to remove the obstacles after they are detected by the 123 Robot.
-
Students will need to select the “Stop” button in the Toolbar to stop the 123 Robot. Instruct students to stop their project when the 123 Robot has detected all the obstacles, has repeated a loop four times without detecting an obstacle, or if it gets stuck at the edge of the Field.
Select "Stop"
-
- For groups who finish early and need additional challenges, have them experiment with different starting points. Does their project still work?
- FacilitateFacilitate a conversation with students as they experiment with their projects.
- Prepare students for the trial and error that is an intrinsic part of the experimentation that they will engage in with this challenge. You may want to use the Problem Solving Cycle graphic from the Background page as a visual aide to establish a structure for the problem-solving process with your students.
Student Problem-Solving Cycle - If students are using a loop in their project with a [Forever] block or [Repeat] block, but the 123 Robot is not moving as intended, they may not have all the necessary blocks inside the loop, or they may sequence the blocks inside the loop in a way that causes the 123 Robot to move in an unintended way.
- Use the Project Stepping feature to help students go through their project one block at a time to see how each block is being executed in their project. This will allow students to see how the loop functions in their project and will give them visual feedback to show which blocks may be causing the error, so debugging can become a more targeted and efficient process. For more information on how to use the Project Stepping feature, see the Stepping Through a Project in VEXcode 123 VEX Library Article.
- Remind students that they can also use the Highlight feature to see which blocks are being executed and when as they run their projects. The following questions can be used to encourage students to identify how a loop affects the project flow with the Highlight feature.
- How does the highlight move when there is a loop in our project?
- Which VEXcode 123 block creates the loop?
- Which blocks are repeated in your project?
- If the 123 Robot is not turning, students may not have added the [Turn for] block. Show students how to add the [Turn for] block so that the 123 Robot changes direction after it detects an obstacle, otherwise, the 123 Robot will just drive forward and stop. Since students may not be familiar with angles, you may want to provide several angles for them to experiment with such as 60, 90, 120 degrees.
- Remind them that they can change the turn angles in the input oval in the [Turn for] block. If experimenting with turn angles, ask students how changing this parameter affects the movement of the 123 Robot. What would happen if we increase the turn angle? How does it change the movements of 123 Robot rover? Does this change have the 123 Robot rover detect more obstacles? If not, try a different turn angle.
Change Turn Angle in the [Turn for] block - RemindRemind students that this challenge requires playful exploration and there will be cycles of trial and error. They will make mistakes in their projects as they experiment, and each time they make a mistake in their code, they have a chance to learn something new! Help students to identify where in the code there was a problem and tease out ideas for addressing the problem.
- Did something go wrong? Great! Where in the code is the problem? How can you change that block?
- Do you need a different block or do you need to change the parameters in this one?
-
What is your favorite mistake so far? What did you learn from it?
- AskAsk students how they think the real Mars rover could use a loop and eye sensor to detect obstacles on the ground before it lands.
Mid-Play Break & Group Discussion
As soon as every group has experimented with their projects to solve the challenge, come together for a brief conversation.
Ask students to show their projects and describe what the 123 Robot is doing. This is a chance to check in on the students' progress and troubleshoot.
- What was working well in your project?
- What challenges have you faced in your project?
Ensure that students understand that they can use a loop to have the 123 Robot repeatedly check for obstacles on the Field.
- Have they used a loop to have the 123 Robot detect multiple objects? If not, remind students about the [Forever] and [Repeat] blocks you talked about in the Engage section.
- If they are using a loop, how are they using it? What blocks are they using to create the loop in their project?
- How does the sequence of the blocks in the loop affect the behaviors of the 123 Robot rover?
- What happens if some of the blocks are not in the [Forever] or [Repeat] loop? Will those blocks be repeated?
Prepare for the challenge variation in Play Part 2:
- What if we change the location of the obstacles? Will this project still work? Why or Why not?
Part 2 - Step by Step
- InstructInstruct students that they are going to move the obstacles on the Mars landing area and continue to experiment with their projects. The goal is to have the 123 Robot detect all the obstacles in the Field, even if their location changes! They will use what they have learned about loops and the [Repeat] or [Forever] block to update their projects. View the animation below for one example of how a 123 Robot might complete this challenge and clear every obstacle using a Forever block.
Video file
- Note that the animation stops after all of the objects are detected and removed, but a [Forever] loop would make the 123 Robot run forever in that loop until the project is stopped.
- ModelModel for students how set up the Field and test their project.
-
First, show them how to place the obstacles in new locations on the Field, and to choose a starting point and mark it with an “X.”
123 Field setup -
Once the obstacles and 123 Robot are in place, they can select ‘Start’ in VEXcode 123 to test their projects.
Select ‘Start’ to test the project - Remind students that they will need to select the “Stop” button in the Toolbar to stop the 123 Robot.
- There are many possible solutions for this challenge. The following is one example for reference.
Possible Solution -
-
- FacilitateFacilitate a conversation with students as they test their projects.
- If students need help making the 123 Robot repeat sections of code to detect all the obstacles on the field, suggest that they use a [Repeat] block or a [Forever] block as you talked about during the Engage section, and show them how to use it in their projects. Encourage them to make sure that the entire project is inside the C-block, as shown below.
Add a [Forever] Block - If students have built a project, but it isn’t detecting all of the objects, encourage them to experiment with turn angles, give them the following turn angles to experiment with such as 60, 90, and 120 degrees. How do the turn angles affect the movement of the 123 Robot?
Changing the Turn Angle Engage students in further discussion as they build their projects to have them share their thinking as they iterate on and test their projects.
- Which obstacle does the 123 Robot detect first in your project?
- What does the 123 Robot do after it detects an obstacle? What blocks have you used to make it do this?
- What blocks have you used to have the 123 Robot move to the next obstacle after one is cleared?
- How does your project have the 123 Robot to clear the entire landing area?
- RemindRemind students to start from the same point for the tests. They just want to change one variable — the location of the obstacles.
-
Also, remind students to start with the Eye Sensor on the 123 Robot facing the first obstacle, this will have the 123 Robot travel to the first obstacle quickly and will enable students to have immediate success with their projects.
Eye Sensor faces object
-
- AskAsk students to think about how their project has changed throughout the challenge.
- How has your project changed from the start of the lab until now?
- What did you change in your project to make it work better?
- What change did you make that made it less successful? How did you fix it?