All post of ElecFreaks

Micro: bit Fundamental Course–Button&Display

By August 15, 2017 No Comments

In our last blog  Start Your Micro:bit Programming Trip we have talked about the basic operation method of Microsoft Makecode. In the following articles, we will teach you some fundamental functions of blocks one by one .

Our purpose:

To know basic usage of Makecode through studying buttons and blocks.

Materials we need:


USB Cable×1

On Micro:bit, there are 5*5 LED metric dot display and 2 buttons. And today we are going to learn how to use button and LED display together.

Our requirement:

Press down a button to display its relative direction. Press 2 buttons together for clearing the display.


Step 1:

Drag out block “on button pressed” from Input column and set the button to be “A”.


Under block “on button A pressed”, we insert block “show arrow”, which can make micro:bit to display directions with arrow. And here we set direction to be “west”.


Step 2:

Choose block “on button pressed”, cope and paste it. Then set button to be “B” and direction to be “East”.


Step 3:

Drag out block “on button pressed” from Input column again and set the button to be “A+B”.


Insert “clear screen” into this block.


Step 4:

In the left analog window, we can check analog operation. Click Virtual button on Micro:bot to check our program.


Step 5:

After confirmation, download program into Micro:bit.



If we want to use character string to display “west” and “east”, then how to revise our program?

VN:F [1.9.13_1145]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)
Micro: bit Fundamental Course--Button&Display, 10.0 out of 10 based on 1 rating

Author song

More posts by song

Leave a Reply