Step 0. Using your web browser, go directly to https://makecode.microbit.org to land the MakeCode for micro:bit home page. You can bookmark this package to easily open this package for next project. In the My Projects section, click on the New Project

For more information about MakeCode, please go to our tutorial: What is MakeCode


Step 1. In the Toolbox, click on the Logic category. Then  drag an if-then block   and place it inside the forever block

Step 2. In the Toolbox, click on the Input category. Then  drag a pin P0 is pressed block and place it inside the condition field   of the if-then block

Step 3. In the Toolbox, click on the Basic category,  drag a show leds block  and place it inside the if-then block, then draw a “←” by clicking the dots in the 5×5 matrix (see following picture)

Step 4.  right-click on the If-then block and click Duplicate from the shortcut menu and you will get whole duplicated block. change P0 to P1, draw a “→” to replace “←” in the 5×5 matrix and drag and drop the new block inside the forever block. See following figure:

Step 5. Name your project in field (1) of following picture and click download as following picture:

Step 6. Send new project to your MICROBIT disk

Below are the full program blocks  we made for your reference:

Complete wiring and power up, when you press P0 button, the micro bit shows ←,when you press P1 button, the micro bit shows →. You can play a game with your friend “whose action is faster”(the colors of buttons are subjected to the product you receive)