Python with Robots - Middle School
Python with Robots
A hands-on Python coding curriculum for Middle School, taught through programming the CodeBot.
About this Digital Textbook
Python with Robots takes middle school students from their first lines of Python code through programming the CodeBot robot. Across four units, students build progressively more complex programs - starting with the CodeSpace IDE and robot hardware, then moving into loops, functions, sensors, and autonomous behaviors.
Each unit is broken into short, guided missions that pair coding objectives with classroom-ready lesson plans, assignments, vocabulary, review questions, and standards alignment.
Unit 1: Bot Basics
This unit introduces students to CodeSpace, Firia's Python IDE, and the CodeBot robot. Across three guided missions plus a remix project and unit assessment, students get oriented to the IDE, meet the robot hardware, and write their first Python programs to control CodeBot's LEDs and motors.
Missions in this Unit
- ▸ Mission 1: Welcome to CodeSpace: An introduction to the CodeSpace Development Environment.
- ▸Mission 2-1: Students will learn about the peripherals of CodeBot and identify them as input or output.
- ▸Mission 2-2: Students will connect CodeBot to the computer and learn the basics of Python.
- ▸Mission 3-1: Students will control CodeBot LEDs with specific timing and sequencing.
- ▸Mission 3-2: Students will convert between decimal and binary numbers and use them to control LEDs.
- ▸Mission 3-3: Students will move the CodeBot by powering the wheels.
- ▸Mission 3-4: Students will use button presses to control robot movement and follow an algorithm to move the 'bot in a square pattern.
- ▸ Unit 1 Remix & Assessment: Students apply skills from Missions 1-3 in an original CodeBot remix project, and demonstrate mastery through the Unit 1 Assessment (review questions and rubrics).
📐
Standards Addressed
▾
CSTA Standards - Grades 6-8
Additional Standards for Team Projects
Unit 2: Interactive Systems
This unit takes students deeper into Python programming through the Animatronics project. Across four guided missions, students learn to use infinite and counting loops, respond to button input, work with the random module, and write their own functions with parameters. The unit culminates in Mission 4-4, where students combine LEDs, movement, and music into one complete Animatronics program.
Missions in this Unit
- ▸Mission 4-1: Students will use an infinite loop to constantly blink the user LEDs in a cool pattern.
- ▸Mission 4-2: Students count the number of guests using a button press and display the count using line sensor LEDs.
- ▸Mission 4-3: Students create a program with movement, random beeps, and a function that plays a note.
- ▸Mission 4-4: Students play a fanfare and combine three programs into one complete project.
- ▸ Unit 2 Remix & Assessment: Students apply skills from Mission 4 in an original CodeBot remix project, and demonstrate mastery through the Unit 2 Assessment (review questions and rubrics).
📐
Standards Addressed
▾
CSTA Standards - Grades 6-8
Additional Standards for Team Projects
Unit 3: Sensor Smarts
This unit builds on students' Python foundation as they put CodeBot's sensors to work. Across two guided missions plus a remix project and unit assessment, students learn to read real-time data from line sensors, use that data to drive decisions with if statements and Boolean logic, and progressively develop two complete robotics programs - a boundary-detecting fence patrol and a full five-sensor line follower with proportional steering control.
Missions in this Unit
- ▸Mission 5-1: Students will read and display data from CodeBot's line sensors.
- ▸Mission 5-2: Students will use functions to read data from CodeBot's line sensors and use the data to control the line sensor LEDs.
- ▸Mission 5-3: Students will use data to count line detections and display the count in binary using the red user LEDs.
- ▸Mission 5-4: Students will create a program that reads line sensors and uses the data to move CodeBot within a boundary.
- ▸Mission 6-1: Students will detect lines using line sensors and display the data on LEDs using a Boolean list.
- ▸Mission 6-2: Students will create a line follower that uses two sensors for turning and three sensors for moving forward.
- ▸Mission 6-3: Students will create a line follower program that uses all five sensors for proportional steering control.
- ▸ Unit 3 Remix & Assessment: Students apply skills from Missions 5 & 6 in an original CodeBot remix project, and demonstrate mastery through the Unit 3 Assessment (review questions and rubrics).
📐
Standards Addressed
▾
CSTA Standards - Grades 6-8
Additional Standards for Team Projects
Unit 4: Mission Control
This unit pushes students into advanced sensor programming as CodeBot becomes fully autonomous. Across two guided missions plus a remix project and unit assessment, students tap into infrared proximity sensors, system monitoring sensors, and the accelerometer. They write auto-calibration functions, build feedback-driven displays for battery health and temperature, and program the 'bot to track and chase a moving object - putting skills from every prior unit to work in a true capstone project.
Missions in this Unit
- ▸Mission 7-1: Students use proximity sensors to detect an object.
- ▸Mission 7-2: Students can write calibration functions so the 'bot can adapt to its environment.
- ▸Mission 7-3: Students will use proximity sensors to program the 'bot to track and chase an object.
- ▸Mission 9-1: Students will use system sensors to monitor battery power and display battery health with a UI.
- ▸Mission 9-2: Students will use system sensors to monitor system temperature and display unacceptable temperatures with a UI.
- ▸Mission 9-3: Students will use input sensors to monitor physical orientation.
- ▸ Unit 4 Remix & Assessment: Students apply skills from Missions 7 & 9 in an original CodeBot remix project, and demonstrate mastery through the Unit 4 Assessment (review questions and rubrics).