Students program their model to move through a course considering the best use of motor controls.
Questions to investigate
How does the task to complete determine the way a robot needs to move? Why is documenting moves important?
- Ensure SPIKE Prime hubs are charged, especially if connecting through Bluetooth.
- Ensure students have built the Hopper model, which was used in the Hopper Run lesson.
Ignite a discuss with students about different types of racetracks – tracks for cars, tracks for people, tracks for bicycles, etc. There are many different types of tracks that you can race across. Consider showing videos or images of different types of racetracks.
Challenge students to create a track for the race that includes straight areas and turns.
Each group should design a basic racecourse for Hopper to move through. The course should have at least 5 steps including straight moves and turns.
Students will program their Hopper to run the course.
Discuss with students how Hopper can be programmed to move in the needed ways to run along the trail. Identify different ways that they could get the motors to move without changing the design of the model.
Prompt students to think of different ways that each motor can move to make the model go straight or turn.
- For example, motor E might move quickly while motor F moves slowly using a Motor Pair tank move.
- For example, one motor could move using degrees while the other is stopped.
Ask students to write a pseudocode program to explain the needed steps and programming elements to complete the race.
Open a new project in the Python programming canvas.
- Ask students to erase any code that is already in the programming area.
For this challenge, tell students to include a code comment using the # in their code for each step of the track moves to explain the movement of the model (i.e. moving straight, way it turns, moving backwards).
Encourage students to complete one step of the race at a time. Testing and iterating on the program will be important during this challenge. Remind students to watch their console for error messages and to reference the Knowledge Base as needed for help.
Allow students to share their final programs and how they programmed Hopper.
- How did you program your Hopper to move through the different parts of the race?
- What debugging issues did you have? Did you have any error messages during programming?
- What was difficult about this challenge?
Ask students to review the code comments used in their program to determine if the code was documented well and is easy to follow. Discuss several examples as a class to think about best practices in documenting.
Allow students to try racing on other courses developed by other groups. Students will need to create a new program in order to complete the new course. Remind students to test their program several times in order to ensure it moves as expected from the pseudocode. Ask students to add code comments using # to explain the steps of the program.
Discuss the program with students.
Ask students questions like:
- How did you approach programming each step for the challenge?
- Why was documenting each step of your program important?
- Why is testing your programming at each step important?
Have students answer the following in their journals:
- Why is checking each step of a long process one way to saw time debugging?
- What was difficult about this challenge?
- What characteristics of a good teammate did I display today?
- Ask students to rate themselves on a scale of 1-3, on their time management today.
- Ask student to rate themselves on a scale of 1-3, on their materials (parts) management today.
- Create a program to move through a series of steps and turns.
- Utilize motor pair in multiple ways.
- SPIKE Prime sets
- Devices with the SPIKE App installed.
- Student journals
Design projects that combine hardware and software components to collect and exchange data.
Use flowcharts and/or pseudocode to address complex problems as algorithms
Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs.
Incorporate existing code, media, and libraries into original programs, and give attribution.
Systematically test and refine programs using a range of test cases.
Document programs in order to make them easier to follow, test, and debug.
Engage effectively in a range of collaborative discussions (one-on-one, in groups, and teacher-led) with diverse partners on grade 8 topics, texts, and issues, building on others' ideas and expressing their own clearly
Present claims and findings, emphasizing salient points in a focused, coherent manner with relevant evidence, sound valid reasoning, and well-chosen details; use appropriate eye contact, adequate volume, and clear pronunciation
Follow precisely a multistep procedure when carrying out experiments, taking measurements, or performing technical tasks
Acquire and use accurately grade-appropriate general academic and domain-specific words and phrases; gather vocabulary knowledge when considering a word or phrase important to comprehension or expression
Develop a model to generate data for iterative testing and modification of a proposed object, tool or process such that an optimal design can be achieved.