Getting Started Guide

11/16/2017 Getting Started with the micro:bit - learn.sparkfun.com
https://learn.sparkfun.com/tutorials/getting-started-with-the-microbit?_ga=2.220747408.983033930.1510848989-204410570.1509632255 5/8
When you open MakeCode you are greeted with two blocks: the On Start block and the forever block. The On Start block is all of your code that will execute at the very
beginning of your program and only run once. The forever block is code that will loop over and over again…forever.
We are going to use the forever block for building this “Hello World.” We now need to start adding blocks to forever .
First, click on the Basics category. These blocks are, well, the basic building blocks of a BuildCode program. It will expand into a number of options. Click and drag the
show leds block over and place it inside of your forever block. Notice that the block is keyed to fit inside of the forever block, and if you have the volume up on your
computer you will hear a satisfying ‘click’ noise when you let go of the block.
The show leds block has an array of squares that symbolize the LED array. If you click on a square, it will turn red, which means that it is ‘on’. Draw a simple pixel art shape
by turning different LEDs on or off; you should be able to see the outcome in your simulator on the lefthand side of your window.
To turn this static image into an animation we need another show leds block to place just under the first block. You can then make a second drawing with this set of
rectangles. In your simulator you will see the images switching really, really fast. We need to slow this down!
To slow your animation down you will use the pause block, which is under the basic block set. The pause block is just what it says; it tells the micro:bit to pause and wait for a
certain amount of time. Place two pause blocks in the program as shown.
The reason we are using two and placing one at the end is that this program is a loop. Without the block at the end, the image in your animation will change really, really fast.