Old-Timey Twitter

Challenge

The microbit radio can be used to send text over short distances. In this exercise we will try using the radio functions to send text messages to microbits in the immediate area. The same code should be used on each microbit for sending and receiving.

Requirements

Extensions

Hint: radio.config(channel=20)

Example Solution


from microbit import *
import radio

radio.on()

your_tweet = 'hi'

while True:
    if button_a.was_pressed():
	   radio.send(your_tweet)

    received_tweet = radio.receive()

    if received_tweet:
        display.scroll(received_tweet)

    sleep(100)