Source: https://mokxi.com/teachers/plans/micropython-pico
Updated: 2026-11-11

Lesson plan

# MicroPython on the Pico lesson plan

Real Python on a Raspberry Pi Pico: blink and the REPL, buttons and if, loops and PWM, a knob on the ADC, lists and functions on an LED bar, an OLED on I2C, and a reaction game boss.

4 chapters, 7 lessons, about 3 hours, on the Raspberry Pi Pico. Every lesson runs in the browser, with nothing to install.

Start a class from this course

The unit

## Objectives and materials

### By the end, students can

- Blink two LEDs, type Python live into the board, and make choices with if.
- Fade with a for loop and PWM, and read a knob with the ADC.
- Lists and functions on an LED bar, and text on an OLED over I2C.
- A reaction timer with a random wait, a cheat catcher and a best score.

### Materials for the whole unit

- Full-size breadboard
- LED x 6
- OLED display, 128x64
- Potentiometer
- Pressure, humidity and temperature, BME280
- Pushbutton
- Raspberry Pi Pico
- Resistor x 6

Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.

Chapter 1. About 50 min

## First Python

Blink two LEDs, type Python live into the board, and make choices with if.

Lesson | Time | What students do

Blink, and talk to the board Your first MicroPython program blinks two LEDs, then you type Python straight into the board with the REPL. | 25 min

- Run it
- print() talks back
- The REPL: Python you type live
- Drive a pin by hand

Buttons and if Read a button with a pull-up, make a choice with if and else, and print only when something changes. | 25 min

- Run it and press
- if and else
- Print only on a change
- Turn it round

### Materials

- LED
- Pushbutton
- Raspberry Pi Pico
- Resistor

### Check for understanding

Each student finishes "Buttons and if" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Turn it round".

Chapter 2. About 50 min

## Loops and sensors

Fade with a for loop and PWM, and read a knob with the ADC.

Lesson | Time | What students do

Loops and a PWM fade A for loop with range() steps an LED from dark to bright and back, using PWM to fake the levels in between. | 25 min

- Run it
- range() does the counting
- while True: forever
- Make it breathe slower

Read a sensor with the ADC A knob on GP26 turns into a number with ADC, and that number sets the LED brightness. Then a little math turns it into a percent. | 25 min

- Run it
- Voltage in, number out
- Halfway is half bright
- Your own scale

### Materials

- LED
- Potentiometer
- Raspberry Pi Pico
- Resistor

### Check for understanding

Each student finishes "Read a sensor with the ADC" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Your own scale".

Chapter 3. About 50 min

## Bigger programs

Lists and functions on an LED bar, and text on an OLED over I2C.

Lesson | Time | What students do

Lists and functions on an LED bar Six LEDs in one list, and two small functions that turn a number into a moving dot or a growing bar. | 25 min

- Run it
- A function is a named job
- Spot the difference
- Write your own pattern

I2C to an OLED screen Two wires carry a whole conversation: find the OLED and a weather sensor on I2C, then draw text on the screen. | 25 min

- Run it and scan
- Text on the screen
- Make it hot
- Your own screen

### Materials

- Full-size breadboard
- LED x 6
- OLED display, 128x64
- Pressure, humidity and temperature, BME280
- Raspberry Pi Pico
- Resistor x 6

### Check for understanding

Each student finishes "I2C to an OLED screen" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Your own screen".

Chapter 4. About 25 min

## Boss game

A reaction timer with a random wait, a cheat catcher and a best score.

Lesson | Time | What students do

Boss game: reaction timer Wait for the light, then hit the button. Functions, if, loops, random and the board clock come together in one game that keeps your best score. | 25 min

- Play it
- No cheating
- A best score
- Make it yours

### Materials

- LED
- Pushbutton
- Raspberry Pi Pico
- Resistor

### Check for understanding

Each student finishes "Boss game: reaction timer" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Make it yours".

Your class

## Teach this unit as a class

Start a class from this course and its 7 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.

The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.

Start a class from this course See the demo class

More units

## Other lesson plans

Electronics basics 20 lessons, about 10 h. Embedded on the Arduino Uno 16 lessons, about 12 h. Embedded on the ESP32-C3 13 lessons, about 11 h. Embedded on the Raspberry Pi Pico 7 lessons, about 6 h. Build your own fight stick 5 lessons, about 4 h. Embedded on the STM32F411 6 lessons, about 6 h. C++ on a board 13 lessons, about 10 h. Digital logic and memory 4 lessons, about 4 h. Interactive devices on the Uno 9 lessons, about 8 h. From gates to a computer 23 lessons, about 16 h. Build a claw machine 8 lessons, about 6 h. Every unit All the courses as ready-made units, on the teachers page.
