Micro:bit - Explained

Introduction

The BBC micro:bit is a small version of a computer, with its own processor, memory, and other features like LEDs, buttons, and sensors. You can create a simple program on your computer and upload the code to the micro:bit device, which will perform your desired tasks (like displaying the air temperature, turning on fans, etc.).

Many electronic devices like TV remotes, washing machines, and kitchen timers all contain a tiny computer inside, which enables them to do some specific functions. On the other hand, we can write codes to make micro:bit do different types of tasks. Some of these we will be exploring during our LEaFS Journey.

Different Parts of a micro:bit Device

The micro:bit has 2 programmable buttons (A and B), which can be pressed to trigger any command written in the code. In the center of the micro:bit, there are 25 LEDs, which can be switched off or on individually. So, different numbers, letters, or simple graphics can be shown there (for example, the smiley face in the image below). It also has an accelerometer that can detect motion (much like the accelerometers in phones, which help with changing a screen's orientation as you rotate the phone). Additional sensors and outputs include a compass, temperature sensor, light sensor, and Bluetooth antenna.

Figure 1: Detailed Hardware of Micro:bit (source: microbit.org/get-started/user-guide/overview/)

At the lower edge of the micro:bit, there are three General Purpose Input/Output Pins, named P0, P1 and P2, to which different kinds of devices and sensors can be connected. There is another pin called 3V which acts as power input/output port. The last pin, named GND (from "ground"), helps to complete a circuit (You may watch this video to know more about "Circuit").

Some tasks require you to connect the positive end and the negative end of a device to the 3V pin and GND pin respectively. However, DO NOT directly connect 3V and GND to each other, as this will cause a short-circuit and damage your micro:bit!

How to Write Code for micro:bit

Figure 2: Block-based Editor for Micro:bit

You may write code for micro:bit using a block-based interface (see Figure 2). Here, you can drag and drop the blocks and can do programming pretty easily. You will be learning more about the block-based programming during the LEaFS Journey.

If you're ready for some extra challenge, you can use text-based interface to program in the Javascript or Python languages.

To learn more, check out the official site of the micro:bit!

Source: Some portions were adapted from the book, Programming the BBC micro:bit: Getting Started with MicroPython, by Simon Monk.