Teacher Resources: Python with Robots MS - Mission 3-2
Bright Byte Lights Lesson 2
Students will convert between decimal and binary numbers and use them to control LEDs.
Overview
Mission 3-2 introduces students to binary numbers - the foundation of how all computers store and process information. Students learn to convert between decimal and binary, then apply that knowledge directly to hardware by using binary values to control CodeBot's user LEDs and line sensor LEDs.
🎯 Mission Goal: Students will convert between decimal and binary numbers and use them to turn on/off user LEDs and line sensor LEDs on CodeBot.
Learning Targets
- I can define "bit" and "byte".
- I can convert a decimal number to binary.
- I can convert a binary number to decimal.
- I can use a binary number to turn on/off user LEDs.
- I can use a binary number to turn on/off line sensor LEDs.
Key Concepts
- Computers use binary numbers to represent all information.
- You can control (turn on and off) LEDs using binary numbers. This is much faster, and fewer lines of code, than turning on and off each LED individually.
- Binary numbers have only two digits: 0 and 1, and use the base-2 number system.
Assessment Opportunities
- Quiz after Objective 6
- Mission 3 Lesson 2 Log
- Submit completed program BinaryLEDs
- Submit the program with extensions
- Mission 3 Obj. 6 Review Kahoot!
Success Criteria
- Convert a number between 0 and 15 to binary
- Convert a binary number to decimal
- Convert a number between 0 and 255 to binary
- Write code using binary to turn on/off user LEDs
- Write code using binary to turn on/off line sensor LEDs
Digital Resources
- ▸Mission 3 Lesson 2 Slides
- ▸Mission 3 Lesson 2 Log
- ▸Mission 3 Lesson 2 Answer Key
- ▸BinaryLEDs sample code
- ▸Mission 3 Obj. 6 Review Kahoot!
- ▸Secret Coders video (introduces binary numbers and Activity #1)
Classroom Materials
- ▸CodeBot
- ▸USB cable
Real-World Applications
Extensions & Cross-Curricular
🔤
Vocabulary
▾
🐍
New Python Code
▾
0b for binary, then 0=off, 1=on for each LED)
📐
Standards
▾
CSTA Standards — Grades 6–8
- Make sure CodeBot robots are charged and USB cables are ready.
- Watch the Secret Coders video ahead of time so you can introduce it naturally and answer questions.
- Review the BinaryLEDs sample code so you can help students who get stuck on the binary LED syntax.
- Consider having a printed binary/decimal conversion chart handy for students who need a visual reference during the activities.
- Binary conversion is often the toughest concept in this unit. The Secret Coders video does a great job making it accessible - show it before students start the activities to give them a concrete mental model.
-
When students write
leds.user(0b00001111), connect it back to what they already know: each 0 or 1 in the binary number maps directly to one LED being off or on. This makes the bit/byte concept tangible. - Watch for students confusing the number of LEDs (8 user, 4 line sensor) with the binary place values. Remind them that for user LEDs they need an 8-bit value, and for line sensor LEDs they need a 4-bit value.
- The Kahoot linked above is a good warm-up or exit ticket for Objective 6. Run it as a class before the quiz to help students feel confident.
Lesson Outline
Students can write in their log first and then share, or discuss first and then write in their log.
- Question: How many ways can you represent the value 5?
- This question is to get students to think about how the number we use is just a symbol. There can be many ways to represent 5: fingers, objects, tally marks, domino or die, words, math problems, etc. This is a good question to have students share out their ways and see how many representations they can come up with. You can show slide 3 for examples.
- Question: How does a computer represent 7?
- Students are not expected to know the real answer to this question. Appreciate their creativity as they discuss how a computer may represent 7. Some students may know that a computer uses binary numbers.
Each student will complete a Mission Log. Students could work in pairs through the lesson, or they can work individually. They will need a CodeBot and cable for the lesson.
Optional: 🗝️ Mission 3 Obj. 6 Kahoot! Review - A review Kahoot! is available for this objective. You can do the Kahoot together as a class, or assign it independently.
If you are not doing the three activities on binary and decimal conversion, you can skip the Kahoot! Review, or use the Mission 3 Obj. 1-6 Kahoot! Review.
- There are 2 slides that discuss real-world applications and how computers use binary to represent all data. You can expand on this information as needed.
- You can use an extension or cross-curricular activity as a post-mission activity.
- You can use the Mission 3 Obj. 6 Kahoot as a lesson review. (link above)
- End by collecting the Mission 3 Lesson 2 Log.