Linux Format

Micro:bit Radio

-

For this tutorial, we used a radio link to connect two micro:bits, which enabled strings of data to be sent between devices. This used the default radio settings for ease of use. But what if we wanted to create multiple robots for battle in an arena? This is where channels come into play.

The radio class has many different configurat­ion options available to the user, but the most basic is channel. To change the channel of the radio we must use:

import radio radio.config(channel=99) radio.on()

So now we can change the channel from 0 to 100. This must be done for every micro:bit that you wish to have on a certain channel.

If you would like your radio signal to go further, then you’ll need to increase the power of the transmissi­on. This is also a configurat­ion option and is handled with:

radio.config(power=7)

Transmissi­on power ranges from -30, -20, -16, -12, -8,-4, 0, 4dBm with each of these seven values relating to a configurat­ion value of 0 to 7 respective­ly.

If you would like to know more about sending radio signals using the MicroPytho­n then head over to an excellent official resource here: https://microbit-micropytho­n.readthedoc­s. io/en/latest/radio.html.

Newspapers in English

Newspapers from Australia