Lift-Off with CodeX - Mission 2: Lift-Off!
Lift-Off!
Let's go to Mars! Students build a power switch for the engines, a countdown sequence for personnel, and a launch button for Mission Control, all while refreshing their Python skills.
Overview
Let's go to Mars! This mission is all about getting the rocket ship off the ground. Students create a power switch for the engines, a countdown sequence for personnel, and a launch button for Mission Control.
Two new input peripherals show up here, a switch and a button, and each one controls a different part of the launch. Students read those inputs inside an infinite loop, branch on what they find, and break out of the loop when the launch begins. Ideally students refresh their Python knowledge as they get the mission to Mars underway.
🎯 Mission Goal: Students write code to simulate the launch of a CodeX spacecraft.
Learning Targets
- I can describe the difference between a button and a switch.
- I can read the value of a button and a switch.
- I can use an infinite loop to continuously check the values of the button and switch.
- I can use a button and a switch to control an LED.
- I can break out of a loop.
- I can display a countdown sequence.
Key Concepts
- Understand the difference between a button and a switch. The switch locks in place while the button does not.
- The project uses two input peripherals, a button and a switch. Each one controls a different aspect of the lift-off project.
- Use three branches in the infinite loop. One branch will have two conditions.
Assessment Opportunities
- Check for Understanding in CodeSpace (2)
- Mission 2 Assignment
- Practice evaluating conditional statements
- Exit ticket - construct a conditional statement
- Submit and/or check the LiftOff program
- Journal entry on their learning experience
Success Criteria
- Use a switch to turn the red LED on and off.
- Use a button to launch a countdown sequence.
- Show a countdown sequence on the CodeX display that includes a flashing white LED.
Digital Resources
Classroom Materials
- ▸Laptop/computer with the Chrome browser
- ▸CodeX and connecting cable
- ▸Red and white LED peripherals
- ▸Switch peripheral
- ▸Button peripheral
Real-World Applications
Extensions & Cross-Curricular
🔤
Vocabulary
▾
🐍
New Python Code
▾
True (not pressed) or False (pressed).
True (out) or False (in).
📐
Standards
▾
CSTA Standards - Grades 6-8
CSTA Standards - Grades 9-10
CSTA Standards - Grades 11-12
- Students need a computer or laptop with the Chrome web browser.
- Make sure students can successfully log in to make.firialabs.com.
- Sort the switch, button, and white LED peripherals ahead of time so each group can grab a set quickly.
- Build the launch sequence yourself once before class so you can demonstrate the switch, the countdown, and the launch button confidently.
- Remind students to be gentle as they connect and disconnect the peripherals from the CodeX. You can work with students in small groups as they practice.
- This project gives students plenty of opportunities to engage in the computational thinking skill of abstraction. Encourage students to carefully read about abstraction in Objective 5, and keep reminding them that when they create functions, they are practicing abstraction.
- The concept of algorithms is also in this mission and throughout the mission pack. Review and practice algorithms with your students and encourage them to see algorithms in their daily lives.
- Extensions and cross-curricular projects are included to enhance the concepts in the mission. Use the extensions to extend students' programming experience. A remix is not explicitly planned here, but you can add one as an option for additional learning. A remix is planned after Mission 3.
Lesson Outline
Students access prior knowledge by answering the pre-mission questions in the assignment doc.
- Ask: "What is the difference between a light switch on the wall and a doorbell button? Why would a designer pick one over the other?"
- Ask: "If you were in charge of launching a rocket, what would have to be true before you were allowed to press the launch button?"
Set up the launch scenario and front-load the new input code before students start typing.
- Frame the project: a power switch for the engines, a countdown for personnel, and a launch button for Mission Control.
-
Introduce
exp.digital_in(exp.PORT0)for setting up an input peripheral, next to theexp.digital_out()students already know. -
Walk through the values carefully.
switch.valueisTruewhen the switch is out andFalsewhen it is in.button.valueisTruewhen it is not pressed. - Sketch the three branches of the infinite loop on the board before students code them: engines off, engines on and waiting, engines on and launch button pressed.
Students work through the mission objectives in CodeSpace, taking notes and answering questions in their assignment doc as they go.
- Connect the switch and the button to the CodeX and set them up as digital inputs.
- Read the switch value and use it to turn the red engine LED on and off.
- Build the infinite loop and add the three branches, including the branch that checks two conditions.
-
Write the countdown function, using
display.fill()and the flashing white LED, and complete the Checks for Understanding. - Break out of the loop at lift-off and finish the LiftOff program.
True that should be a False.Bring the class back together to lock in branching, abstraction, and algorithms.
- Ask: "Why is a switch the right choice for engine power and a button the right choice for launch?"
- Ask: "Walk me through your three branches. What has to be true for each one to run?"
- Ask: "What does the countdown function hide from the rest of your program, and why is that useful?"
- Ask: "Where does your program break out of the loop, and what would happen if it never did?"
Students answer the reflection question in the assignment doc, add a journal entry about their learning experience, and submit the LiftOff program.
Use the Mission 2 Review Questions or the Mission 2 Review Kahoot! through whichever method you prefer, class discussion, Kahoot!, or an LMS quiz.