Radio communication


What are we going to do?

In this activity we are going to learn a bit more bout micro:bit's radio communication

  • Objectives
    • Understand how to use the Radio blocks to send and receive data between micro:bits
    • Understand the specific types of data that can be sent over the Radio

At the end of this activity, we'll be able to send and receive data via radio between two micro:bit boards. We'll use morse code to send data, so first we'll have a look at the morse code.

morse code

morse code

Materials

micro:bit board

The micro:bit was designed to be classroom-friendly from day one. More approachable than just coding, it's a great way to achieve fun, practical results with motivated students. Buy from here starter kit (recommended) or board only.

micro USB cable

If your micro:bit board didn't came with a USB cable, any microUSB cable should do the trick

Computer

The code editor is web based, so any computer with a web browser (and Internet connectivity) will do

Instructions

1 Open editor

Once you've opened the editor, pick a name for your project. Remember that it should be something that easily identifies it. To create a program, you just have to select some blocks from the left side of your page and drag and drop them to your workspace.

Click to zoom

2 Code

From the list of possible blocks, choose the ones needed to code something like the picture below. You can test your program with the simulator on the left of the screen. Once you're happy with the result, click on "Download".

Click to zoom

3 Upload to the board

When the program is ready and you click "Download", an HEX file will be downloaded to your computer (normally to your download folder). If download succeeded, a message will appear on your screen. Click "done".

Now, connect your micro:bit board to your computer using the micro USB cable. Your computer should now detect your micro:bit just as if it was an external drive. Search the HEX file you just downloaded and drag and drop them on your micro:bit drive. On windows you can right button on the HEX file and click send to MICROBIT.

Click to zoom

4 Final result

After a few seconds, your program should start on your micro:bit board.

Congratulations, you're on the right path to be a maker!, now continue with the following challenges! 🙂

Now it's your turn!

Now it's time to start using this awesome code to send some secret messages! Do you accept this challenge?

  • To send a secret message, first choose your words. Keep it short and simple, you don't need to form a full sentence. Here you have some examples:
    • Question: doing? Answer: Fine
    • Question: color? Answer: Red
    • Question: Name? Answer: Peter
  • Now translate it to morse code. Here you have an example:
    • Normal - Question: color? Answer: Red
    • Morse code - Question: −°−°Π−−−Π°−°°Π−−−Π°−° Answer: °−°Π°Π−°°
  • Finally, send it using A and B buttons on your micro:bit board

What else?

Now that you know how to communicate via radio, you can send some messages with morse code!

IMPORTANT! If you're working in pairs, each pair has to have a different "radio group". For example radio group 1 for pair one, radio group 2 for pair two... Both components of the group need same radio group id but different to other pairs.

And finally, as I know you liked the dodge ball game from last activity very much, here you have another game, the snake game!! You just have to download it and send it to your micro:bit board.

To play:

Press B to turn right and A to turn left. Try to catch as many apples (dots) as you can without crashing!

 

 


Continue your maker journey with the next activity: Humbot mi:sumo assembly

or return to maker workshop main page