The micro:bit not only offers the ability to learn how to code but also to see how your code works in a practical way. This leson activity illustrates how the micro:bit can be used to create a name badge using the on board button inputs and LED matrix.
- Get a basic understanding of how to use the MakeCode editor to programme the micro:bit.
- See how the use of an input can be used to trigger an output.
- MicroUSB Cable
- 2 x AAA Batteries
Download the Code
Dr Bit Code
Click the button below to download the Dr Bit solutions for this challenge. The Dr Bit file is contained within a zip folder.
To download Dr Bit PC software kindly click hear.
To download the Dr Bit app kindly select one of the links below.
Time to Code
As you go through these steps please note that there is an image of the completed code below.
- All of the blocks required for this lesson can be found in the ‘Basic’ tab and ‘Input’ tab of the MakeCode editor.
- Begin by opening the ‘Input’ tab and selecting the ‘on button pressed’ block. This will be your input. By default, button A is selected.
- Now that you have an input, you can use it to control an output. For this name badge lesson the output will be to display your name on the LED matrix.
- Locate the ‘show string’ block in the basic tab and connect it to your input. Enter your name into the text field.
- The code is now finished! Download your code and upload it onto the micro:bit.
When you press button A on your micro:bit your name will scroll across the LED matrix screen. Once your name has finished the LED matrix will turn off until you press button again.
Taking it Further
- Explore the various inputs that makecode has to offer and try then out on your name badge.
- Create different outputs using the blocks under the basic tab. Try using your name to show numbers or even images.
- Use textiles to create a micro:bit holder that can pin onto a t-shirt to make the name badge more realistic.
Keep in Touch
We would love to keep in touch with you and as a result aid you along your digital making journey.
Becoming a digital maker subscriber means you will receive exclusive offers and we will keep you up to date with new resources and kits, as well as upcoming events and workshops.
Let us know how your digital education journey is progressing. Send us pictures and videos of your awesome creations and use the hashtag below.