Programming with BBC Micro:Bit

This resource aims to support teachers who are teaching physical computing in the primary setting. This should help to develop a secure understanding of some ways in which we can teach children programming and the key principles of computational thinking.

The national curriculum states that pupils in key stage 1 should be taught to understand what an algorithm is, create and debug simple programs and use logical reasoning to predict the behaviour of programs. In key stage 2, pupils should be designing, writing and debugging programs which deliver specific goals within physical systems. Therefore this resource links directly with the Department for Educations statutory guidance for computing at both key stage 1 and 2.

Using the BBC micro:bit in school

The BBC micro:bit is a programmable computer, perfectly suited to primary school pupils who are learning about physical computing and programming. This device can be used and explored by pupils in a variety of ways and the possibilities are endless. Below is an example of how the micro:bit can be used in a medium term plan. This could be adapted to support younger years in KS1, where creating/designing programs is not a requirement. For additional ideas, visit the micro:bit website.

Medium term plan of 5 lessons (KS2)

Lesson 1 – To start with, exploring the anatomy of the micro:bit is a good activity (and this could be adapted and changed to suit younger years). This could be delivered in a number of ways, however a sorting a matching activity is always fun. This could be repeated as a starter activity in future sessions and a good assessment for learning tool.

The device is a powerful tool in which children can start to explore programming, and therefore, if pupils know and understand all the components, they can utilise this device to it’s full potential. See the micro:bit anatomy page for more information.

Lesson 2 – In the second lesson, introduce Scratch to the pupils. If they are familiar with the program, recap with the pupils the keys blocks and what their functions are. If not, more time may be needed to explore all the functions and features within the program. In addition to this, allow them to play games with the BBC micro:bit on Scratch and explore the code within each game to develop their understanding of sequencing and algorithms. To find out how to connect the BBC micro:bit to Scratch, click here.

Lesson 3 – Using ideas from the games played in the previous lesson, get pupils to design their own simple game which uses the BBC micro:bit controller. Encourage the children to think about the ways in which they could utilise the features of the controller. (For example, will the game use the A and B buttons?)

Lesson 4 – In this lesson, the pupils should start to create their sprites (if time is limited, then Scratch offer a stock selection that could be used instead). Once this is completed then they should start coding their game. Encourage the pupils to use logical reasoning to explain expected outcomes of each of their scripts. This will be useful for AfL and addressing any misconceptions.

Lesson 5 – During this lesson, the games should be shared with the rest of the class. Peer assessment could be used to discuss any problems. Encourage the children to use debugging and logical reasoning to correct any problems with the algorithms.

Scratch game: ‘Micro:Drive’

This video below shows the game that I have created called ‘Micro:Drive’. It uses the BBC micro:bit as a controller, and it acts as both and input and an output device. It is important for pupils to have a solid understanding of the differences between input/output devices, and this game hopefully demonstrates it in an interesting and engaging way.

An input device sends information to a computer whereas an output device receives information from a computer and completes the associated actions.

Debugging/coding activities

Once the pupils have had a go at playing the game with the micro:bit, give the pupils a set of tasks to complete. This could be simply to get them to see if they can get the car to go faster or slower, or to see if they can change how long the game is played for. These tasks are relatively straight forward, and would suit most year groups. However, for higher attaining children and older years, they may need to be challenged to ensure their learning is extended. An example task could be to see if pupils can create another coloured car to play alongside the original one, or to use the ‘b’ button as a input device. The pupils can use their prior knowledge of scratch to help them, as well as drawing upon other code in peers games and duplicating and scripts that might be relevant. At key stage 2, pupils should be set tasks that require them to use decomposition. This is the idea of solving problems by making them into smaller parts. Pupils could be presented with lots of extra blocks of code (that aren’t needed to make the game work), and they have to use logical reasoning to explore which ones to get rid of.

Sequencing activities

Another way of introducing Scratch and the BBC micro:bit to children is by setting them sequencing activities in Scratch. To start, tell the children that the game has a few problems which you need their help to fix. The first problem for the children to fix is using the micro:bit to control the car. When the micro:bit is tilted left/right/up/ or down the car should move accordingly. You could show the pupils an example of what the code looks like when the arrow keys are used to steer the car. Then, allow them time to explore the other elements of code you have suggested to get the car moving. Can the pupils order and sequence the blocks correctly? This activity can be simplified and adapted to suit a range of ages. With younger years, using an activity called ‘scratch unplugged‘  is a way in which pupils can explore code and algorithms away from the computer. The blocks of code can be cut out and then the children can physically manipulate the code, sequence it in the correct order and use logical reasoning and computational thinking to complete the task.

BBC micro:bit as input/output device

The micro:bit has the capacity to work as both an input and output device. In the game that I have created, I have utilised both of these functions. When the car is driven over the gold coin, the player has to press the ‘a’ button for them to collect it. This therefore is acting as a input device, as a signal is sent to the computer when the button is pressed to collect the coins. Every time a coin is collected, and at the start of the game the micro:bit displays content across the LED lights. Examples of this are shown in the video below.

Creating your own controller

Computing has strong cross curricular links with maths (sequencing and coding) and also design and technology (designing the game). This is mentioned in the National curriculum programme of study, and therefore it is important to make these links when possible, to make the learning more creative and meaningful for the pupils. Children can enjoy creating their own design for the BBC micro:bit if it is used in school. These can be created using low cost materials such as cardboard and wood. 3D printers are great to use for more complex designs. Below are some images of some controller designs.