Python Project-Based Learning: Building Clocks and Watches with Smart Watch Displays
These lessons are general to all of our kits. We often use the Pico OLED for many examples since that is the kit we have been using for the longest time.
These lessons focus on using functions like the MicroPython localtime() to get the time in your current timezone.
They also focus on drawing scalable numbers on different size displays and drawing times on larger color displays.
Here are some sample lesson plans for a 14-week semimester hich school course on learning computational thining by using MicroPython to write clock and smartwatch application. This course assumes no prior knowledge of programming.
Weeks 1-2: Introduction to Python and Basic Concepts
Lesson 1: Introduction to Python
- What is Python?
- Why learn Python?
- Data Science
- Artificial Intellegence
- Python Installation and Setup
Lesson 2: Hello, World!
- Writing the first Python program
- Drawing a simple rectangle to the screen
- Making the rectangle bounce around the screen
- Understanding Python syntax
- Using the graphics library for your clock or watch
Lesson 3: Variables and Data Types
- Introduction to variables
- Common data types (integers, floats, strings, booleans)
- Drawing with pixels, lines and rectangles
- Chainging color
Lesson 4: Basic Operations
- Arithmetic operations
- Concatenation and repetition
- Assignment operators
- Lists of colors
Weeks 3-4: Control Structures and Functions
Lesson 5: Conditionals
if
,else
, andelif
statements- Alternating the color of your lines
- Horizontal and radial lines
Lesson 6: Loops
for
andwhile
loops- Loop control with
break
andcontinue
- Draing the tick marks on a watch
Lesson 7: Functions
- Defining and calling functions
- Arguments and return values
Weeks 5-6: Working with Libraries and Hardware
Lesson 8: Importing Libraries
- What is a library?
- Importing and using libraries
Lesson 9: Introduction to Hardware Interaction
- Communicating with smart watch displays
- Sending and receiving data
Weeks 7-8: Project 1: Basic Digital Clock
Lesson 10: Planning the Project
- Project overview
- Creating a project plan
Lesson 11: Building a Basic Digital Clock
- Displaying time on the smart watch display
- Updating the time
Weeks 9-10: Intermediate Python Concepts
Lesson 12: Lists and Dictionaries
- Creating and manipulating lists and dictionaries
Lesson 13: Error Handling
try
andexcept
blocks
Weeks 11-12: Project 2: Analog Clock Display
Lesson 14: Planning the Project
- Project overview
- Creating a project plan
Lesson 15: Building an Analog Clock Display
- Designing an analog clock
- Rotating clock hands based on the current time
Weeks 13-14: Advanced Python Concepts and Optimization
Lesson 16: More About Functions
- Lambda functions, higher-order functions
Lesson 17: Optimization Techniques
- Improving code efficiency
Weeks 15-16: Final Project: Customizable Clock/Watch
Lesson 18: Planning the Project
- Project overview
- Creating a project plan
Lesson 19: Building a Customizable Clock/Watch
- Adding customization options (color, style, etc.)
- Implementing user input for customization
Lesson 20: Final Project Presentations
- Students present their final projects
- Review and feedback session
Ongoing: Reflection and Feedback
- After each project, have students reflect on what went well, what they struggled with, and what they learned.
- Continuously solicit feedback from students to improve the learning experience.
This outline provides a balance between teaching Python concepts and applying them to real-world projects, which can keep students engaged and help them to better retain what they've learned. Tailor this outline to meet the specific needs and pace of your students, and ensure to provide plenty of opportunities for students to practice their skills, ask questions, and get feedback.