Python Level-1 with Virtual Robotics - Mission 11: Airfield Ops
Airfield Ops
Students use line sensor data and math operators like integer division, modulo, and exponents to guide CodeBot through airfield runway operations.
Overview
In this mission, CodeBot works the airfield: it follows a dashed white line down the runway, counting each dash along the way. Students use the running dash count with math operators, integer division (//), modulo (%), and power (**), to drive real behavior: lighting up LEDs as a position indicator, triggering a scary sound every 8th dash, and flashing proximity LEDs at red markers. It's a line-follower mission at its core, but the focus is on gathering data and using math to turn that data into action.
π― Mission Goal: Students will learn math operations that help with airfield runway operations.
Learning Targets
- I can use line sensor data to detect a white line.
- I can use line sensor data to count dashed lines.
-
I can use the number of dashed lines with math operations
//,%, and**. - I can gather data and use the data to accomplish tasks.
Key Concepts
- CodeBot can gather data, like line sensor readings, and use it to accomplish tasks.
-
Besides addition, subtraction, multiplication, and division, other math operators are useful in programming:
//integer division,%modulo (remainder), and**power (exponent).
Assessment Opportunities
- Quiz after Objective 6
- Code Tracing Chart as a debugging tool
- Use the Debugger to track variables for each math operation (Obj 4, 5, and 6)
- Give students code snippets from an objective and have them explain what it does
- Give extra practice with the math operations
- Submit final runway clearing program
- Mission 11 Review Kahoot!
Success Criteria
- CodeBot follows a dotted white line.
- CodeBot stops at the end of the white line.
- CodeBot uses LEDs as a position indicator.
- CodeBot makes a scary sound every 8 dashes.
- CodeBot's proximity LEDs light up for each red marker.
Digital Resources
Classroom Materials
- βΈComputer or Chromebook with internet access
Real-World Applications
Extensions & Cross-Curricular
π€
Vocabulary
βΎ
π
New Python Code
βΎ
next_marker power.
π
Standards
βΎ
CSTA Standards - Grades 9-10
CSTA Standards - Grades 11-12
Certiport IT Specialist: Python Standards
PCEP: Certified Entry-Level Python Programmer
- This mission is another line-follower program, with new applications. The CodeTrek shows code for a new program.
- You have a choice: if you want students to practice the line-follower algorithm again, and have it be simpler than Mission 9, they can follow CodeTrek and start new code. They can also use their former code (from Mission 9 or Mission 10) and add to it to meet the goals for Mission 11.
-
If students reuse a previous program, they just need to change the line sensor condition from a black line to a white line: change
ls.check(threshold, is_reflective)tols.check(threshold, True)for a white line. - For the other objectives, the code modifications and functions can be added just as easily to a previous program, or to a new one.
-
The value of
TOTAL_LINESmay need to be adjusted to meet the goal, depending on the 'bot and track setup - expect some trial and error.
Lesson Outline
Ask students what dashed lines on a runway or road might be used for, and how a pilot or driver (or a robot) could count them to know where they are. Connect this to the mission: CodeBot is working the airfield, following a dashed white line and using the dash count with math operators to figure out what to do next.
- Switch the line sensor condition to detect a white line instead of a black line, and follow the dashed line down the runway.
- Count each dashed line as CodeBot passes it, building toward Objective 3.
- Use Mission 11 Obj 3 as a reference, and administer extra practice or a code-explanation activity as needed.
-
Objective 4: use integer division (
//) on the dash count to light up LEDs as a position indicator. -
Objective 5: use modulo (
%) so CodeBot makes a scary sound every 8th dash. Reference Mission 11 Obj 5. -
Objective 6: use the power operator (
**) so CodeBot's proximity LEDs light up for each red marker. - Administer the Quiz after Objective 6.
- Bring detecting, counting, and all three math operations together so CodeBot completes a full runway clearing run: following the line, stopping at the end, indicating position with LEDs, sounding off every 8 dashes, and flagging red markers.
- Reference Mission 11 Obj 7 and the Final Code Solution as needed.
- Have students submit their final runway clearing program.
Close with the Level-1 Mission 11 Review Kahoot! to reinforce integer division, modulo, and the power operator before moving on to the Unit 4 Remix & Assessment.