The BBC micro:bit is a tiny programmable computer with a wide range of hardware features that we use to introduce prospective students to the joy of programming for the Cloud and for mobile platforms, including the Internet of Things.
We are going to use the Block language and Microsoft's MakeCode editor for writing programs. Once the program is complete, you need to download it and flash it (transfer it to the microbit).
Below, we propose a small number of exercises to become familiarised with micro:bit.
This is the process of transferring a program to a micro:bit. Let's get started with this quick guide, where you will learn how to develop a basic program and how to flash it.
- Hover the mouse pointer over to top part of the screen and click on the USB icon that will show up.
- Select
ARM BBC microbit device
. After a few seconds, the micro:bit should appear in the file explorer.
Optionally, you may want to learn how to use your smartphone to flash a micro:bit program via bluetooth. If so keep reading and follow the steps below, else jump to the next section:
- Install the app for your handheld device from here.
- Open the app and pair your micro:bit with your handheld device.
- Access the
MakeCode
editor from the app. - Using your file manager application of choice (
File Explorer
in Windows), drag and drop the file containing your program to the micro:bit.
A more detailed tutorial on the use of this app, including videos describing how to pair a micro:bit can be found here.
Once you've practiced how to flash a program, let's get started with some small programs. We are proposing a list of exercises by order of complexity. If you don't have time to complete all of them during the session, keep exploring the resources at home!
For each of the exercises below, write the program using the MakeCode
editor and flash it to your micro:bit:
- Display your name: can you print
UoL
on the LED screen? - Smiley buttons: learn how to interact with the micro:bit by using its buttons.
- Night night light: learn how to modify the brightness of the LED screen. To start straightaway, click on activity (don't forget to complete the challenges!).
- Dice: combine maths with micro:bit's sensors in order to implement a dice.
- Coin flipper: turn your micro:bit into a funny coin flipper.
- Rock-paper-scissors game: use the accelerometer to build the logic of this simple game, involving variables and choice making.
- Temperature: turn the micro:bit into a thermometer. To start straightaway, click on activity.
- Block language
- Reference material
- Flashing code onto the micro:bit
- Mobile Apps for micro:bit
- More details on the micro:bit hardware
This is a good 14 week tutorial for the non-initiated, which will help you build a good foundation for studying your CS/SE degree: https://makecode.microbit.org/courses/csintro
More lessons can be found here and some project ideas here. For example:
- using the micro:bit to perform scientific experiments: https://makecode.microbit.org/courses/ucp-science
- exploring extensions: https://makecode.microbit.org/extensions