The BBC micro:bit is a pocket-sized computer that allows you to have loads of fun whilst learning digital technology and computer science. You can program it using block-based coding and build anything - from simple programs to light up LEDs, to robots, musical instruments and more.
In this tutorial, you will create a friend detector - a wrist-mounted gadget that lights up with a smiley face when your friends are nearby.
- A BBC micro:bit - you can buy one from Amazon by following this link
- A computer connected to the internet
- A micro USB cable (if you by the micro:bit Go kit linked above it contains this already). You may need a UBC-C to USB-A adapter if your computer only has USB-C ports (for example modern Macs).
- A micro:bit battery pack and batteries (if you by the micro:bit Go kit linked above it contains this already)
- Some duct tape (I recommend this rainbow duct tape)
- Velcro
The steps to complete this workshop are:
- Getting started
- Writing your first micro:bit program
- The friend detector
- Code the on start
- Code the forever block
- Detect radio messages
- Run the code
- Build a wrist band
Work through these steps one by one. Each step includes a link to the next step at the end.
If you want to use a working version of the code, you can import the project using the microbit-FriendDetector.hex
file in the Code
folder.
- Clone or download this repo
- From the MakeCode home page select the Import button
- Select Import File
- Locate the
microbit-FriendDetector.hex
file from theCode
folder in this repo - Select Go ahread! to load the project in the MakeCode editor
You can also import the code from this URL - makecode.microbit.org/_du14RM7mT4fC.
- Copy the URL
- From the MakeCode home page select the Import button
- Select Import URL
- Paste in the URL
- Select Go ahead! to load the project in the MakeCode editor.
I hope you enjoy this workshop. If you want to get in touch, you can find me on twitter - @jimbobbennett. I'd love to hear what you are building.
Feel free to raise issues with any bugs you've found, or any suggestions for changes and improvements.