How to Program micro:bit

About 3 hours

Ages 8+

What Will You Make?

We will create a coded badge with our micro:bit which we can wear everywhere, and have fun with the code. We will start by making a basic version, creating sequences with the Micro:bit leds

What Will You Learn?

We will take our first steps in programming, we will learn to program the LEDs, to experiment with the micro:bit code.

Program Your micro:bit

Step 1

In order to program your micro:bit using blocks, we are going to go to https://makecode.microbit.org/ and click on ā€œNew Projectā€.

Step 2

Now we see our workspace, divided into three:

  • Left: This is our simulator, where we can see our code work.

  • Middle: this is the blocks menu

  • Right: Here we will work with our code and logic.

Step 3

The first thing we are going to do is go to the menu – ā€œBasicā€ and select the ā€œShow Iconā€ block and drag it into our ā€œforeverā€ block, wait a moment and in the simulator section we can see the result.

We click on ā€œShow Iconā€ and it displays the different options for our LEDs, we choose the happy face and in a few moments we see the change in the simulator.

Step 4

Now we will create an icon from scratch, we want to make our own. Let’s go ā€œBasicā€ and choose ā€œshow ledsā€ and drag it to the ā€œforeverā€ block and remove our ā€œshow Iconā€. And we draw by clicking on the led matrix.

Step 5

Now we are going to combine them, we are going to put our ā€œshow ledsā€ in ā€œon startā€, We are going to menu – ā€œBasicā€ we take the block ā€œpause (ms) 100ā€, we place it after ā€œshow ledsā€ , and we put our ā€œshow iconā€ inside the ā€œforeverā€ block.

Step 6

We see the result in our simulator. In the simulator section, at the bottom of the micro:Bit we have some buttons, the second button is to restart the emulator.

Step 7

Now we can experiment, for example with the pause time, we click on ā€œpause (ms) 100ā€ and select the time we would like.

Step 8

To download the code, we connect our micro:bit to the computer and click on the three dots next to the Download button, select ā€œConnect deviceā€, and follow the instructions to download it.

Ready we can see the result in our micro:bit.

Resources

Media

What Is Happening Here?

Getting Started with MakeCode

We are taking our first steps in programming using a block language, using the combination of these we can create sequences.

Also something amazing about MakeCode, is that you can also program in JavaScript and Python, which allows us to explore different ways of solving problems.

What Is Next?

More micro:bit Projects

You can experiment with sequences, and even create little animations to personalize your badge. You can also check out the other projects in the Maker Camp library, to create a voice recognition AI to turn on your LEDs, or even create a crochet badge to include your micro:bit.

About MoonMakers

MoonMakers — led by Camila and Diego Luna —Ā  are a community of creators passionate about knowledge. A Makerspace, an open space with different digital manufacturing machines. And a YouTube channel where we promote science, technology and the maker movement.

MoonMakers have collaborated with companies such as: Sesame Street, Make Community and in Mexico with Educational Television and Fundación Televisa, creating educational content.

We have given workshops throughout the Mexican Republic with: Talent Land, Secretary of Education in Jalisco, Conacyt, Centro Cultural EspaƱa.

MoonMakers

Materials:

  • Micro:bit
  • Battery base
  • Batteries
  • micro USB to USB cable
Makeyland Graphic

Sign up for monthly project ideas for young makers from the leading maker educators.

FEEDBACK