BBC Micro:bit has been designed to be an easy, child-friendly and practical approach to coding within schools. This can be adapted to work across schools in varieties of cross-curricular subjects, not just Computing.
As part of Physical Computing, one method of using the BBC Micro:bit, is by adapting it to become an Input Device; linking its digitalised inputs to be linked with other programs and computer software. Within this page below, an example of how to use the BBC Micro:bit this way is described through an example use of programming it to become a wireless game controller.
Linking Scratch and the Micro:bit
What is Scratch?
Scratch is a programme that uses block-coding as a programmable language that allows the user to program and share games, animations, stories and more online. As children create with Scratch, they learn to think creatively, work collaboratively, and reason systematically whilst building on the aims of the National Curriculum for pupils to understand and use digital systems.
How can Scratch be used in the classroom?
Using Scratch in the classroom has many benefits, including allowing children to explore algorithms and programs before creating and writing their own. Using Scratch’s programmable games can create activities that develops computational thinking for children of all ages. Children can be tasked to explore existing games, remix coding, write their own, create sprites and potentially code their own games. Being able to use the block-coding of Scratch develops children’s skills to become computing literate by writing algorithms, debugging and sequencing coding and using logical reasoning.
Linking Scratch with a physical system, like the Micro:bit, allows pupils to experiment with algorithms and digital devices, whilst providing opportunities to develop computational thinking and understanding of input and output devices.
Micro:bit as an Input Device in Scratch Game
The BBC Micro:bit can be programmed to become children’s very own game controller.
The video below displays a game, created on Scratch, that could be created and demonstrates an example of how the accelerometer can be programmed as an input device to sense changes in movement of the Micro:bit, which turns the device into a controller to move characters around on the screen, as well as the A/B buttons used to make selections at the beginning of the game. Within the example video, by tilting the Micro:bit left, right, up and down, this changes the directional movement of the fish outputted on the screen to ensure she dodges incoming dangerous sea creatures that swim across the screen.
Micro:bit as an Output Device
Additionally, the Micro:bit can also be programmed to become a simple output device. The LED screen can be used to display messages throughout the game, including saying hello to the player, telling them ‘GO!’ when game starts as well as displaying ‘WELL DONE’ when the player completes the game by surviving the designated time or ‘GAME OVER!’ when the player loses their 3 given lives.
Examples of this can be seen in the videos below.
Example Medium-Term Plan
Here is an example of possible overview for a topic of work, using the BBC Micro:bit:
- Lesson 1 – Introduction to the Micro:bit – Children begin to play and explore the Micro:bit, developing an understanding of input and output devices.
- Lesson 2 – Play a variety of Scratch games – Play a variety of example games (some with and without the use of the Micro:bit as a controller) so children can begin to experience how the games are coded; understanding physical and digital devices and get their own ideas .
- Lesson 3 – Sequencing activities – online and offline activities where children learn to write and debug algorithms.
- Lesson 4 – Extension activity – Children are tasked to add and code new sprites into an example game.
- Lesson 5 – Beginning to remix and/or create their own game – Children start to design and edit their own backgrounds and sprites whilst starting to write their own code.
- Lesson 6 – Continue to create and code their own games – Children continue to develop their own algorithms, using sequencing and debugging any potential problems.
- Lesson 7 – Finishing and share games with class – Children finish off their own games and play each others’ games (additional lessons can be added if needed).
Below are detailed explanations of some of the lesson’s activities; including what each of them are, examples of how to apply this into the classroom and how it supports children’s development of their computational skills. Although these are aimed for children within KS2, these can be easily be adapted to support younger learners.
Learning to use the Micro:bit
Before children can start using the versatility that the BBC Micro:bit has to offer, pupils must first get to know the device and have time within lessons to experience what it does and how to make it work.
- Introduce the Micro:bit and the anatomy to children so they develop and understanding of what the device is, it’s features and what it is capable of.
- Allow children to play and experience the Micro:bit and begin to code. Use the Micro:bit’s Block-Editor to begin coding and experimenting with the device and potentially set children challenges that they need to code. Here you can also find additional example Block-Editor lesson plans and ideas.
- Play a Micro:bit anatomy loop-card game to support children to become more familiar with the parts of the Micro:bit in a fun and engaging activity. A copy of this can be downloaded and printed for classroom use.
Unplugged Sequencing Activity
Creating an offline sequencing activity provides pupils a chance to physically handle and move coding-blocks around, moving and fitting the coding pieces together like a puzzle, supports children’s understanding of how to create algorithms that they then can trial out on Scratch.
If errors arise, teachers can check the class’ coding and encourage children to change the position of the blocks to debug their algorithm. This develops their computational thinking and logical reasoning as it supports and demonstrates how the layout and order of the blocks affects the sequencing of algorithms.
The video below shows an example of this offline activity in action using printed scratch coding-blocks. This example and other algorithm from ‘Swim Flora, Swim’ can be downloaded, printed and cut out to use in your own classroom.
Additionally the children can take it in turns to with other algorithms to ‘act out’ the coding within pairs – one child being the ‘sprite’ and the other being the ‘controller’. This allows children to follow explore the code and develop understanding of sequencing and logical reasoning of their acted out algorithms. Children can transfer these offline skills when using Scratch or the Micro:bit.
Sequencing Activity on Scratch
This activity within Scratch tasks the children to ‘fix the code’ for a sprite/aspect of the game, to put the code back together. Having the coding pieces all jumbled up ready limits the potential blocks needed so that focus on the correct sequence is ??
This sequencing activity allows the development of computational thinking as children need to think, solve and correctly order each of the coding blocks provided for them to create a working algorithm.
Recommendation: Using partner work for this activity not only offers paired support, but logical reasoning naturally arises within the children’s joint conversations; where pupils discuss and reason together their choices for positioning of each block to create the correct sequence for the algorithm.
The video below shows an example of this activity and some of the logical reasoning that is used when thinking about the placement of each coding block.
Extension Coding Task on Scratch – Adding new sprites
This task creates an extension challenge where the children can be tasked to add additional sprites into the game (preloaded and made available for pupils within Scratch’s backpack) and write the algorithms needed to make it move accordingly.
In this example seen in the slideshow, pupils are challenged to add a crab as another dangerous sea creature for Flora the Fish to avoid during the game or adding seaweed as another background decoration that moves across the screen as it is ‘swum by’. Children can duplicate algorithms from existing sprites that do the task already and using decomposition and logical reasoning children will need to adapt the code to make sure the algorithms work for the new sprite.
Note: Children should have a comfortable amount of experience with Scratch and a developed understanding of logical reasoning to tackle this activity. will use their Adding a new sprite into the game.