Welcome!

Ok, so you want to learn how to program the micro:bit to create awesome projects. Or, it's part of a subject you're doing and so you're learning because you have to. Either way, that's great. The micro:bit is an easy to program yet fun and very useful device which you can use to create many things and learn how to code.

Introduction

The micro:bit is a small, simple, low powered computer, with a bunch of built in sensors, which can easily be programmed to do a whole range of things.

On the following pages we will work through a series of activities building interesting deviced and exploring various concepts in programming.

Outline

  • Security device - learn about IF statements and the accelerometer by making a simple security device that triggers based upon motion.
  • More coming soon...

This will expland over time as I get round to adding more activities.

Features of the micro:bit

The micro:bit may be a small, cheap computing device but it still packs quite a few useful features. These include:

  • compass
  • 3 axis accelerometer
  • temperature sensor - is actually a built in thermometer on the CPU but it gives you a reasonably close approximation of the ambient temperature.
  • light sensor - runs some of the LED's in reverse to achieve this. (I didn't even know this was possible until I read about it.)
  • radio and Bluetooth
  • 5 x 5 array of red LED's (dimmable)
  • two buttons (either side of the screen)
  • external connector pins (which can both read and write both digital and analog signals). You can connect, for instance, LED's (including colour changing LED's), speakers, motors, microphones to name just a few things.
  • USB interface - usually used to transfer programs to the micro:bit but can also be used to send data to a computer whilst a program is running.

micro:bit

With a bit of creativity there is so much potential for what you can do with these things.

Programming the micro:bit

The micro:bit is very easy to program. Whilst it is possible to download an application to program the micro:bit, most people create their programs using the MakeCode editor. This is a web based editor which allows you to program using either text or a drag and drop graphical interface. This is great as there is no software to install and you can be up and running straight away whether you are on Windows, Mac, Chromebook or Linux.

When you have your program ready to go, uploading it to the micro:bit is very easy.

  • Download the program from within the editor.
  • Plug the micro:bit into a USB port on your computer (it will show up as an external storage device)
  • Copy the program onto the micro:bit external storage device (only one program may be on the micro:bit at a time, your new program will automatically overwrite the previous one. An orange light will flash on the back of the micro:bit to show that the program is being copied over)
  • When the orange light stops flashing the program has been downloaded and is ready to go. Unplug the micro:bit and off you go :)

Have fun!

Hardware Specifications

Here are some details about the hardware specifications of the micro:bit for your general interest. More detailed specifications may be found here.

The processor is an ARM Cortex-M0 32 bit processor (a Nordic nRF51822-QFAA-R rev 3 to be exact) running at 16MHz. ARM is the processor type used on the majority of smart phones and tablets (as opposed to x86 for laptops and desktops). It is a very efficient processor type for low power devices. The processor in your smart phone or tablet is probably running at speeds in the GHz level however which is an order of magnitude higher than the micro:bit.

Your device has 256Kb of storage by way of Flash ROM. I believe only 128Kb of this is available for programs however as the other half is used to store operating code. To put this in comparison, your other devices probably have storage in the many gigabytes. This is two orders or magnitude higher but this is ok as on the micro:bit you aren't storing lots of large multimedia files and only one program as opposed to many.

The working memory (or RAM) on your device is 16Kb. This is quite small compared to the several gigabytes you probably have on your other devices but because the micro:bit is being used in a different way, again, this is not too much of an issue in terms of you using it.

So the micro:bit may appear to have very limited specifications compared to the smart phones, tablets and computers you are used to using. Don't take this to mean that the device is useless however. Because it is designed to be dedicated to a single, simple task the provided hardware is more than capable. If NASA can land people on the moon with a processor running at 2MHz with 2Kb memory and 35Kb of storage then think about what it's possible for you to do with this device.

micro:bit specifications. Obtained from https://tech.microbit.org/hardware/

Acknowledgment

The following pages are a tutorial for the micro:bit. I am not affiliated with or connected with the Foundation in any way. All the content you see here is my own work. Some images and logos you will see on these pages are taken from the micro:bit website which are provided under a Creative Commons licence.