
You Will Need:
- BBC micro:bit.
- A microbit powering method such as a USB Cable.
- A computer with an internet connection and Bluetooth enabled.
- A modern browser such as Chrome/Safari.
You Will Learn How To:
- Create a user account for Scratch.
- Prepare your computer to allow Scratch and the microbit to communicate.
- Prepare the micro:bit for use with Scratch.
- Add microbit support to the Scratch editor.
- Navigate and use the Scratch 'Create' environment.
- Write a program and transfer the program to a microbit.
- Save and share your work, and also how to learn from other peoples work.
Getting Started With Scratch For microbit:
Detailed below is a step by step guide for getting started with Scratch for the microbit. Firstly, we cover everything you need to know to get set up and how to create programs that utilise the microbit. We then cover how users can share their own work and learn from the work of others, which is a big part of the Scratch experience.Things To Note Before We Start:
- This will allow you to integrate the micro:bit into Scratch. Dedicated coding editors such as MakeCode and Python editors remain the best way to make use of the full microbit capabilities.
- Only the blocks you use from the microbit extension will be flashed to the microbit. All other blocks will be executed within Scratch.
Step One - Join Scratch:

- Username and password.
- Age, gender, and country.
- Email address.
Step Two - Install Scratch Link:

- In order to enable communication between Scratch and the microbit, you will need to install their Scratch Link App on your computer. There is a Windows and macOS version of this App. Download the correct version for your machine and install.
- Download the Scratch microbit hex file.
- Plug your microbit into your computer via USB. The microbit should now show up as a removable drive in Windows. Drop the file you downloaded onto the microbit removable drive.
Step Three - Adding microbit Support To The Editor:

Note:
- If you don't have a microbit connected and Scratch Link running, the dialogue box will tell you. If you close the dialogue, you will still be able to write code using the newly added microbit support.
- In order to flash a program over to the microbit Bluetooth on your computer needs to be active and the Scratch Link software needs to be running. I have Scratch Link added to my Windows taskbar to make it easy to start up when I need it.
Step Four - The Workspace:

- The Red Box - Like in the MakeCode editor, the blocks are grouped together in a logical manner. These coloured circles are shortcuts to the various grouped blocks.
- The Green Box - All of the blocks that are available in Scratch are here, and you can scroll through them all from top to bottom. If you use one of the shortcuts in the red box you will jump to the blocks associated with that menu shortcut. When you add support for something like microbit, the blocks will be added to the bottom of the list and a shortcut icon will be added to the bottom of the menus in the Red box.
- The Blue Box - This is the main workspace for the editor and where you build your programs. Select what blocks you need in the red box, grab a block from the green box and drop it into the blue box to build your code.
- The Black Box - This allows you to test your program as you work. If you click on the green flag, the code you have written up to that point will be executed, this includes any animations you have made.
- The Purple Box - This box is for your sprites/graphics/backgrounds. There are two round buttons at the bottom right of this box, one is backgrounds and the other is for sprites. Sprites and backgrounds can be chosen from a library, made in the integrated paint application, or uploaded from your computer.
Step Five - Let's Create Some Code.


What Is Going On:
- When the A button on the microbit is pressed the code below is executed in sequential order.
- A specific costume is chosen for our sprite.
- The sprite is moved to a random location on the screen.
- If the sprite goes over the boundary of the edge of the screen, it is bounced back so it is fully on screen.
- The Sprite is made visible.
- Our Hello World message is displayed in a speech bubble. (usually from the mouth, unless after a bounce in which case all bets are off)
- The message is displayed for 3 seconds.
- The sprite is hidden from view.
- Pressing the A button on the microbit will start the process again.
Sprites:
- Most of the sprites in the Scratch Library have multiple costumes to aid in animation. Some sprites will have costumes that break up walking, or dancing, or waving, and other activities. You can see from the above code that we selected a specific costume in which the dinosaur's mouth was wide open.
- Each sprite can have its own lines of code. If you have multiple sprites or backgrounds, you can click on one and the work area will be blank. Write your code in the normal way and then click on the next sprite that you wish to add code to.
Transferring Code To The microbit:
- Any code that you write for the microbit is automatically flashed over Bluetooth to the microbit.
- Any changes and tweaks you make will also be automatically flashed.
- You can test this for yourself. As soon as you've produced the code press the A button on your microbit and you will see it played out in the test area.
Step Six - Saving, Sharing & Learning:

©Kitronik Ltd – You may print this page & link to it, but must not copy the page or part thereof without Kitronik's prior written consent.