Instructions
THE MAKECODE EDITOR
One really nice feature of the Blocks editor is that the image of a micro:bit on the left
of the screen is a virtual micro:bit that you can run your programs on before flashing
them onto the micro:bit. You can press its buttons with your mouse, it will display
things and if you used the GPIO pins as digital outputs, it will even highlight them
when you write to them. You can also click on GPIO pins to simulate digital and
analog inputs. The middle section of the screen has different categories of blocks:
Basic, Input, Music etc. where you can find blocks to put onto the right-hand
‘canvas’ area. You can also use the Search box just above the list of block
categories if you are not sure where to find the block that you want.
Events
The JavaScript language that underpins the Block editor uses something called
“events”. The “on start” block that our welcome message appears in is an example
of an “event”. The event being that the micro:bit started up, because it was plugged
in or its reset button was pressed. Start a new project (by clicking on Projects and
then New Project) and delete both the on start and forever blocks. Add an on button
pressed (another event) block (in the Input category) and then place a show string
block inside it and change the text that the show string block is to display so that it
looks like this.
Page 20