Fly with Python - Mission 2: Introducing CodeAIR
Introducing CodeAIR
Students meet the CodeAIR drone, identifying key components, connecting to CodeSpace, and writing their first Python program to control the LEDs.
Overview
Mission 2 introduces students to the CodeAIR drone itself. Students learn safety features, identify key components like the power switch and LEDs, and connect the drone to CodeSpace. They are introduced to CodeTrek and Hints, then write and run their first drone program to turn on LEDs. This is where hands-on coding begins.
🎯 Mission Goal: Students will learn about the CodeAIR drone and its LED lights, identifying hardware components, connecting to CodeSpace, and writing their first Python program to control LEDs.
Learning Targets
- I can identify the parts of CodeAIR.
- I can connect CodeAIR to CodeSpace.
- I can create and save a file in CodeSpace.
- I can control LEDs on CodeAIR with code.
Key Concepts
- The battery is charging anytime CodeAIR is plugged in.
- CodeAIR must be turned on to connect to CodeSpace and run code. The switch is tiny!
- Code typed into the text editor is automatically saved to your personal file-system.
- CodeTrek is like your own personal tutor, guiding you through programming challenges.
- Python code is case sensitive. Punctuation is important! That is the first thing to check if an error occurs in code.
Assessment Opportunities
- Quiz after Objective 2
- Quiz after Objective 8
- Complete the program Lights1
- Mission 2 Assignment
- Mission 2 Review Questions
Success Criteria
- Identify key parts of CodeAIR
- Connect CodeAIR to CodeSpace
- Create a program file with code
- Lights1 works correctly and runs without errors
- Complete Mission 2 Assignment
Digital Resources
Classroom Materials
- ▸Laptop/computer with Chrome browser
- ▸CodeAIR, battery and USB cable for each student or programming pair
- ▸Adaptor for USB cable, if needed
Real-World Applications
Extensions & Cross-Curricular
🔤
Vocabulary
▾
🐍
New Python Code
▾
leds.set(0, 50) sets LED 0 to 50 percent brightness.
📐
Standards
▾
CSTA Standards - Grades 6-8
CSTA Standards - Grades 9-10
CSTA Standards - Grades 11-12
- Ensure all CodeAIR drones are charged before class, as the battery charges whenever CodeAIR is plugged in via USB.
- Verify USB cables and any necessary adaptors are available for each student or programming pair.
- Review the CodeAIR Flying Guide so you can help students troubleshoot connection issues quickly.
- The assignment document follows the mission and is a place for guided notes. You can print the document for students (PDF) or assign it digitally through your LMS.
- To run the drone, the CodeAIR must be connected and turned on, even if it is not flying. Also, you must be working in an objective that doesn't show the 3D simulated environment.
- Review questions can be used as a class review, made into a Kahoot!, or used to create an exam in your learning management system.
- Extensions and cross-curricular projects are included to enhance the concepts in the mission. A remix is not explicitly planned, but you can add one as an option. A remix is in the pacing after Mission 3.
Lesson Outline
Students answer two questions in the assignment. They can do a think-pair-share.
Open with a brief discussion to connect prior coding knowledge to physical hardware.
- Ask: "What do you already know about how drones work?"
- Ask: "How do you think a computer program tells a light to turn on?"
Walk students through handling and connecting CodeAIR before they begin the CodeTrek objectives.
- Demonstrate how to safely handle CodeAIR: avoid touching propellers and be aware of static electricity.
- Show students the power switch, which is very small and easy to miss.
- Demonstrate connecting CodeAIR to CodeSpace and creating a new program file.
Students work through CodeTrek objectives to connect CodeAIR and write their first LED program. As they work through the objectives, they should take notes and answer questions in their assignment doc.
- Students connect CodeAIR, turn it on, and verify the connection in CodeSpace.
- Students complete early objectives introducing hardware components (quiz after Objective 2).
- Students create a new program file and write their first lines of Python using
from codeair import *. - Students use
leds.set()to control individual LEDs and complete the Lights1 program (quiz after Objective 8). - Students run Lights1 and verify it works correctly without errors.
Bring the class together to share their Lights1 programs and discuss what they discovered about hardware and software.
- Ask volunteers who did an extension to share their program.
- Ask: "What parts of CodeAIR did you identify today?"
- Ask: "What does
from codeair import *actually do - why do we need it?" - Connect to real world: "Where else do you see programmable LEDs being used?"
Students answer the reflection question in the assignment doc and then submit.
Use the Mission 2 Review Questions through a preferred method: class discussion, Kahoot!, or LMS quiz.