Teacher Resources - Python with Robots MS - Mission 2-2
Introducing CodeBot Lesson 2: Your First Program
Students connect CodeBot to the computer, write their first Python program, and use code to light up the LEDs.
Overview
In Mission 2 Lesson 2, students physically connect the CodeBot to their computer using a USB cable and run their first Python program. They create a new file in CodeSpace, import the botcore leds library, and use Python code to turn user and line sensor LEDs on and off. Along the way, students learn foundational coding practices like writing comments, using correct capitalization and syntax, and understanding Boolean values.
🎯 Mission Goal: Students will connect the CodeBot to the computer, create their first Python file, and write code to control the LEDs.
Learning Targets
- I can safely connect and disconnect the CodeBot using the USB cable.
- I can create a new file.
- I can write code using the conventions of comments and syntax.
Key Concepts
- Python requires all objects - variables, peripherals, etc. - to be spelled exactly the same; capitalization matters!
- Adding comments and blank lines in your code makes it easier to read.
- Python programmers can import a library, or module, to access pre-defined functions.
Assessment Opportunities
- Mission 2 Lesson 2 Log assignment
- Submit completed program LightsOn
- Submit the program with challenges
- Mission 2 Obj 6-10 Review Kahoot!
Success Criteria
- Create a new file
- Import the botcore library
- Use code to turn on an LED
- Use descriptive comments
Digital Resources
Classroom Materials
- ▸CodeBot
- ▸USB cable
🔤
Vocabulary
▾
🐍
New Python Code
▾
Real-World Applications
Extensions & Cross-Curricular
Students will need a CodeBot and USB cable for this lesson. Students can work with a partner (pair programming) or individually for the lesson.
- Decide what materials you want to use for presenting the lesson. The slides can be projected on a large screen.
- Be familiar with the mission log assignment and the questions they will answer. Prepare the assignment to give through your LMS (or print it for each student).
- If you have a word wall, or another form of vocabulary presentation, prepare the new terms.
- This is a good time to discuss common programming practices, such as descriptive variable names, adding comments and blank lines, use of capital letters, etc.
- You may want to create a poster of Python commands to refer back to during the Mission.
Lesson Outline
Students can write in their log first and then share, or discuss first and then write in their log. The two warm-up questions are review from Lesson 1. You can modify them if you want to do a different warm-up.
- Question: What are some peripherals on CodeBot?
- Question: What is the difference between inputs and outputs?
Students need the CodeBot, a USB cable, and a computer or laptop with access to the Internet. The Chrome browser works best.
Each student will complete a Mission Log. Students can work in pairs or individually.
The button MUST be clicked first to connect. You can't just click OK.
The target should be USB CodeBot, not CodeX. The instructions in the slides and workbook will show CodeBot.
The post-mission reflection asks students to reflect on their experience so far with programming. You can change the question if there is something else you want to emphasize with your students. This can be a very good question to share-out with the class.
- What is something you learned about programming today?
You can use an extension or cross-curricular activity as post-mission activity. If students do the challenges (or extensions) you can have students do a gallery walk and appreciate the work and creativity of each other.
Optional: Start a poster for Python code.
End by collecting the Mission 2 Lesson 2 Log.
You can review with a Mission 2 Obj 6-10 Kahoot!