Micro:bit Lesson: Scrolling Name Tag

Lesson Title

Scrolling Name Tag – Create a Digital Name Badge

Grade Level

Middle / High School (Intro CS / Micro:bit)

Time Required

Approximately 30–45 minutes

Learning Objectives

By the end of this lesson, students will be able to:

  1. Explain how the micro:bit LED matrix can display text.
  2. Use a loop to make text scroll continuously.
  3. Program a micro:bit to show their name as a scrolling name tag.
  4. Customize speed and text to suit different situations.

Materials

Key Concepts

Warm-Up (5 minutes)

Ask students:

“If the micro:bit only has 5×5 LEDs, how can it show longer words like your full name?”

Guide them to the idea that only part of the word is shown at a time, and the word moves (scrolls) across the screen.

Activity Part 1 – Basic Scrolling Name (Blocks)

If you’re using MakeCode Blocks, have students follow these steps:

  1. Go to the micro:bit MakeCode editor.
  2. Start a New Project and name it ScrollingNameTag.
  3. In the toolbox, find Basic → show string "Hello!" block.
  4. Drag show string "Hello!" into the forever block.
  5. Change "Hello!" to their name, for example: "JOE".

Resulting logic (Blocks):

  1. Download the program and flash it to the micro:bit.
  2. Watch the micro:bit: their name should scroll repeatedly across the LEDs.

Discussion Prompt: How could this be useful at an event, club meeting, or competition?

Activity Part 2 – Basic Scrolling Name (Python)

If you’re using MicroPython, have students write this code:

from microbit import *

while True:
    display.scroll("JOE")

Students should:

  1. Replace "JOE" with their own name (all caps works best).
  2. Download the .hex file and copy it to the micro:bit.

Their name will now scroll continuously.

Activity Part 3 – Customizing Speed and Style

A. Change Scrolling Speed (Python Example)

Explain that we can slow down or speed up the text using the delay parameter (milliseconds per step).

from microbit import *

while True:
    display.scroll("JOE", delay=100)  # smaller = faster, larger = slower

Have students experiment with different delays:

B. Add an Icon Between Scrolls

Show how to display a simple image after the name:

from microbit import *

while True:
    display.scroll("JOE", delay=120)
    display.show(Image.HEART)
    sleep(500)

Ask students to choose a different image, such as Image.HAPPY or Image.SAD, that matches their personality.

Challenge Extensions (Required)

Pick 1–2 as time allows:

  1. Button A: Start/Stop Scrolling

    Use button A to toggle whether the name is scrolling.

    from microbit import *
    
    scrolling = True
    
    while True:
        if button_a.was_pressed():
            scrolling = not scrolling
        if scrolling:
            display.scroll("JOE", delay=120)
        else:
            display.show(Image.STICK_FIGURE)
    
  2. Button B: Change Speed

    Use button B to cycle through slow, medium, and fast scrolling (teacher or students can design this feature).

  3. Multiple Words

    Scroll "HELLO I AM JOE" as a full phrase, and discuss how spaces help readability.

  4. Event Mode

    Have students wear the micro:bit on a lanyard or clipped to their shirt as a “digital name badge” (battery pack required).

The name of the file will be:
PX_lastname_ScrollName

Files to save on Google Drive under your class and submit to Google Classroom

  1. PX_lastname_ScrollName.png — Screenshot inside Python editor showing your code.
  2. PX_lastname_ScrollName.py — Your Python source file.
  3. PX_lastname_ScrollName.txt — Plain-text copy of your code.
  4. PX_lastname_ScrollName.hex — Hex file to run on the physical micro:bit.
  5. PX_lastname_ScrollName.mp4 — Short demo video of the program running on the board.

Submission requirements

Reflection / Exit Ticket

Have students answer one of the following questions:

  1. In your own words, how does the micro:bit show a long name on a small 5×5 LED grid?
  2. What change would you make in your code to make the name scroll faster or slower?
  3. How could a scrolling name tag be useful outside of class (clubs, conferences, events, etc.)?