Teacher Resources - Fly with Python
Fly with Python
A hands-on Python coding curriculum for grades 6-12+, taught through programming the CodeAIR drone.
About this Digital Textbook
Fly with Python is a four-unit digital textbook that teaches Python programming through autonomous drone flight. Students write their first lines of code in CodeSpace, Firia's browser-based Python IDE, then progress to programming the CodeAIR drone's flight, sensors, and onboard logic.
Each unit breaks down into short, guided missions. Every mission ships with a complete teaching package: learning targets, classroom-ready lesson plans, key concepts, vocabulary, success criteria, assessment opportunities, and standards alignment. Pacing is yours: teach the missions in sequence over a semester, or pull them individually to fit a CS, robotics, or cross-curricular elective.
Unit 1: Drone Discovery
This unit introduces students to CodeSpace, Firia's Python IDE, and the CodeAIR drone. Across three guided missions plus a remix project and unit assessment, students get oriented to the IDE, meet the drone hardware, and write their first programs to control the drone, all without taking flight.
Missions in this Unit
- ▸ Mission 1: Welcome to CodeSpace: An introduction to the CodeSpace Development Environment.
- ▸ Mission 2: Introducing CodeAIR: This mission introduces the CodeAIR drone.
- ▸ Mission 3: Pre-Flight Check: This mission allows students to program the drone without taking flight.
- ▸ Unit 1 Remix & Assessment: Students apply skills from Missions 1-3 in an original CodeAIR remix project, and demonstrate mastery through the Unit 1 Assessment (review questions and rubrics).
📐
Standards Addressed
▾
CSTA Standards - Grades 6-8
CSTA Standards - Grades 9-10
CSTA Standards - Grades 11-12
Additional Standards for Team Projects
Unit 2: Drone Foundations
This unit prepares students to take CodeAIR airborne, safely. Students build a safety interlock with branching if statements, debounce button presses, wrap reusable behavior into functions, and explore the quadcopter power system. Later missions extend into flight maneuvers and autonomous operation.
Missions in this Unit
- ▸ Mission 4: Flight Safety: Students program a set of safety procedures using buttons, branching, debouncing, and a user-defined function to arm the drone.
- ▸ Mission 5: Hovering Flight: Students program CodeAIR to avoid walls and seek an exit using sensors, custom modules, the MotionCommander interface, and variables.
- ▸ Mission 6: Navigate: Students program CodeAIR to fly autonomously using sensor data, exploring the flow sensor for x/y position tracking, battery checks, binary LED patterns, exception handling with try blocks, and a selectable-operations user interface.
- ▸ Unit 2 Remix & Assessment: Students apply skills from Missions 4-6 in an original CodeAIR remix project, and demonstrate mastery through the Unit 2 Assessment (review questions and rubrics).
📐
Standards Addressed
▾
CSTA Standards - Grades 6-8
CSTA Standards - Grades 9-10
CSTA Standards - Grades 11-12
Additional Standards for Team Projects
Unit 3: Drone Operations
This unit moves students into autonomous flight. Across four guided missions plus a remix project and unit assessment, students master the StateMachine task scheduler, formal state handlers, the flight data recorder, and sensor-driven event injection. They put it all together by programming CodeAIR to chart its own gyroscope data and run an autonomous survey of an object.
Missions in this Unit
- ▸ Mission 7: Multitasking: Students program a drone to perform multiple tasks at the same time without blocking program execution, using the StateMachine task scheduler to run non-blocking code for sounds, lights, and sensors.
- ▸ Mission 8: Drone Director: Students combine the task scheduler with formal state handlers to fly precision flight profiles, using the flight data recorder, non-blocking flight commands, and event injection to direct CodeAIR like a film director directs a scene.
- ▸ Mission 9: Attitude Control: Students explore CodeAIR's gyroscope to build a feedback system, charting roll rate live, redirecting chart data to the flight recorder, and using LEDs and motors to give the drone visual and haptic responses to tilt.
- ▸ Mission 10: Survey: Students program an autonomous survey, flying CodeAIR around a box to detect corners, measure each side using state estimators and the Pythagorean Theorem, and capture the dimensions in a Python list.
- ▸ Unit 3 Remix & Assessment: Students apply skills from Missions 7-10 in an original CodeAIR remix project, and demonstrate mastery through the Unit 3 Assessment (review questions and rubrics).
📐
Standards Addressed
▾
CSTA Standards - Grades 6-8
CSTA Standards - Grades 9-10
CSTA Standards - Grades 11-12
Additional Standards for Team Projects
Unit 4: Drone Intelligence
This unit brings artificial intelligence to the drone. Across five guided missions plus a remix project and unit assessment, students master the onboard camera, teach CodeAIR machine vision - first following a line by its brightness, then locking onto a target by color - and finally hand the seeing over to a trained neural network. They finish by building a custom ground control station on a CodeX with live telemetry, infrared pairing, and radio communication.
Missions in this Unit
- ▸ Mission 11: Reconnaissance: Students master CodeAIR's onboard camera to gather aerial visual intel, and learn planned navigation - flying precise, repeatable routes with waypoints.
- ▸ Mission 12: Line Patrol: Students turn raw camera pixels into machine vision, teaching CodeAIR to see a dark line by its brightness and follow it autonomously - no waypoints required - using grayscale conversion, thresholding, and proportional steering.
- ▸ Mission 13: Target Lock: Students move from brightness to color, using HSV color detection and bounding boxes to search for a colored target, judge its size and position, center on it with proportional control, and land right on top.
- ▸ Mission 14: Search Party: Students hand the seeing over to machine learning - loading a trained neural network and flying on its predictions to search for the Cody mascot, photograph it, and land on the helipad.
- ▸ Mission 15: Telemetry: Students build a custom flight controller on a CodeX from scratch in Python - a heads-up display with live telemetry gauges, infrared pairing, and a JSON radio communication layer - turning the CodeX into a ground control station.
- ▸ Unit 4 Remix & Assessment: Students apply skills from Missions 11-15 in an original CodeAIR remix project, and demonstrate mastery through the Unit 4 Assessment (review questions and rubrics).