micro:bit Name Badge: Scrolling Text on the LED Display
Your name scrolls across the micro:bit's LED display from right to left, then a happy face shows and it all starts again. Clip the board on with a battery pack and it becomes a digital name badge. display.scroll moves the text; no extra parts are needed.

Video
Circuit Diagram

Source Code
1# ─────────────────────────────────────────
2# BlueGrays · bluegrays.com
3# micro:bit Name Badge: Scrolling Text on the LED Display
4# ─────────────────────────────────────────
5# Your name scrolls across the LED display from right to left, then a
6# happy face shows and it all starts again. Clip the board on with a
7# battery pack and it is a name badge. No extra parts are needed.
8#
9# Pins:
10# LED -> Onboard 5x5 LED display
11
12from microbit import *
13
14# ============ SETTINGS ============
15NAME = "ADA" # Write your own name here
16SCROLL_MS = 120 # Scroll speed: a smaller number is faster
17FACE_MS = 1500 # How long the face stays on (ms)
18
19while True:
20 display.scroll(NAME, delay=SCROLL_MS)
21 display.show(Image.HAPPY)
22 sleep(FACE_MS)
23FAQ
Why do letters like é, ñ or ü turn into question marks?
The micro:bit's font only has the English alphabet, the digits and basic punctuation. Letters with accents or other alphabets show up as a question mark. Write your name without them: JOSE instead of JOSÉ, ZOE instead of ZOË. Capital letters are easier to read than small ones on a 5x5 display.
How do I use the badge away from the computer?
After uploading the code, unplug the USB cable and plug a battery pack with two AAA batteries into the white socket on the back of the board. The program is stored on the board and starts by itself when power arrives. You can fasten the board to your clothes with a ribbon or a safety pin.
How do I put this code on the micro:bit?
The code is MicroPython. Open the micro:bit Python Editor (python.microbit.org) on a computer, delete the code that is there and paste this one. Connect the board with a USB cable and press Send to micro:bit. If that button does not work, use Save to download the .hex file and copy it to the drive called MICROBIT. You can rebuild the same project with blocks in MakeCode, but this code cannot be pasted there.
Does it work on the older micro:bit (V1) too?
The code is written for the micro:bit V2. Projects that only use the LED display, buttons A and B and the accelerometer also run on a V1. The speaker, the microphone and the touch logo exist only on the V2, so code that uses them gives an error on a V1. If your board has a speaker on the back and a gold logo on the front, it is a V2.
