Standalone microbit scrolling displays

I wanted to make a scrolling display for my desk on parents’ evening, and thought I might use a micro:bit. Then I thought 5 micro:bits might be even better. But how to get them scrolling one message across? I didn’t want to use a computer to control them, I wanted them to be standalone, self-contained. And the radio abilities of the micro:bit mean that no wires should be needed.

So here’s a very simple bit of Python that will turn any number of micro:bits into a rough and ready big scrolling display. There are two different programs, one for the transmitting micro:bit which goes on the right-hand end. Code your message into the Python script and flash it using the Mu editor. When all your other micro:bits are ready, press button A to begin.

--------------------
|RX4|RX3|RX2|RX1|TX|
--------------------

The receiver code goes on all the other micro:bits numbered 1 upwards, lower numbers on the right. Change the number for each device. When powered up they stay blank until they receive the message from the transmitter.

Transmitter code – this goes on the micro:bit on the far right. Code your message in here:

from microbit import *
import radio

message = 'Mr Booth - ICT'

while True:
    if button_a.was_pressed():
        radio.on()
        radio.send(message)
        while True:
            display.scroll(message)

Here’s the receiver code – change the rxnumber for the device number, numbering from 1 on the right, higher numbers as you go left:

from microbit import *
import radio
radio.on()

# set the receive device number here
rxnumber = 1

sleeptime = rxnumber * 750

while True:
    incoming = radio.receive()
    if incoming:
        sleep(sleeptime)
        while True:
            display.scroll(incoming)

UPDATE

Unbeknown to me, Philip Meitiner of the micro:bit Educational Foundation has been working on pretty much exactly the same idea! Can’t wait to see his code as I suspect his is a much more elegant solution:

This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

3 Responses to Standalone microbit scrolling displays

  1. Rich Steed says:

    Love this scrolling display – was going to try and write my own for vocab lists in my classroom but don’t need to now.

    Can I pick your brains – how would you interrupt the message and display a different one without turning the microbits off?

    • blogmywiki says:

      Hi Rich! You could try programming the control micro:bit to send different messages if you press button B, buttons A+B together etc, and see what happens. The other micro:bits should show any message broadcast by the controller. You may need to take some of the while True loops out. Do you want them scrolling as one long display or is the idea that lots of pupils have their own micro:bits scrolling the vocab lists at the same time?

  2. Nikolaos Xenos says:

    thanks, it is a very nice project

Leave a Reply