The micro:bit has made a huge impact on getting “quicker to awesome” in the classroom. From third grade to high school and beyond, it has proved itself to be a platform that is easy to learn and prototype projects on. But sometimes there is that one thing that sometimes just causes you to stub your toe. For many people that is the radio functionality that comes natively on the micro:bit.
If you have two micro:bits sitting around, grab them and join me in this post to take a closer look at how to set up the radio for communication and how to send data from one micro:bit to another. Ready? Good! Here we go…
First of all we are going to be using Microsoft® MakeCode to program our micro:bit! Head on over to makecode.microbit.org!
The radio is native to MakeCode, which means we don’t need to add anything and can just start working with the blocks that are already at hand. You should have just the basic On Start and Forever blocks in your coding area.
Now, the first thing that most people overlook when they are exploring the radio and get hung up on is assigning a group ID to your micro:bit(s). You do that by using the Set Group (#) block. This is the same thing as setting your micro:bit to a specific channel. For two micro:bits to communicate with one another, they need to be on the same channel. This is often overlooked when you are doing this for the first time. For example, we set our micro:bit to group 4. All micro:bits that we are planning on communicating with should be assigned the same group # in the On Start block.
Now that the micro:bit channel is set, we are free to send data out over the radio. Any data that is sent can be heard by any other micro:bit that is on that channel. So, if we were to send the number 3 over the radio on group 4, all other radios on group 4 could receive that number and do something with it.
Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.
Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7pm ET! To join, head over to YouTube and check out the show’s live chat – we’ll post the link there.