So, you’ve got your new micro:bit… now what?
The micro:bit is a small programmable device which can do anything from saying ‘hi’ with the led display to building a robot. But how do you use it? Today we’ll start with the basics of the Microsoft block editor.
1. Go to www.microbit.org and click on ‘Let’s Code’ then ‘Start with this editor’ under ‘Microsoft block editor’.
2. If you’re familiar with Scratch, you should get the hang of this quite quickly. On the right is a list of different types of blocks to choose from. Today we’ll only be using the ‘basic’ and ‘input’ options.
3. Click on ‘input’ and a list of different blocks will come up. For now we only need ‘On button A pressed’. Drag and drop it onto the white area.
4. Now click on ‘basic’ and drag and drop the ‘show string Hello’ block into the ‘button A pressed’ block. Now your code should look like this:
5. Now you can change the message from “Hello” to whatever you want. Congratulations! you’ve just created a piece of code that displays your message if you press the A button. But you haven’t finished yet.
6. Go back to input and get the ‘on shake’ block. Now go to basic and grab the ‘show leds’ block. Now you can create your own pattern by clicking on the boxes. Your code should look like this:
7. Now you’re going to find out how to copy your code to your micro:bit. If you’re on a smartphone or tablet, you’re going to have to cross over to this tutorial here. If you’re on a computer, you can stay here.
8. Now you have to click on the ‘compile’ button on the top of the screen. It will download a .hex file to your computer’s downloads folder.
9. Plug your micro:bit in to one of the computer’s USB ports using the cable that came with it.
10. Using the file explorer, copy or drag and drop the .hex file into your micro:bit.
11. After the file has finished copying, enjoy your new code on your microbit! When you shake it, your pattern will appear on the microbit’s screen, and when you press the A button your message should display.
12. Want to carry your micro:bit around? Then you can connect the battery pack that came with it to the white battery port on the back of your micro:bit.
Feel free to experiment with the block editor, but be careful with the ‘pins’ option.