> For the complete documentation index, see [llms.txt](https://docs.kidscode.co.za/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kidscode.co.za/microbit-beginners/lesson-3/one-two-three.md).

# One, Two, Three

{% hint style="info" %}

## Teachers Notes

In this lesson the kids will code each button on the micro:bit.&#x20;

The program will word as follows:

* When button A is pressed, the LED's will show 1.
* When B is pressed, the LED's will show 2.
* When A+B is pressed, the LED's will show 3.

The kids will use the **show string** block to display the numbers and the **Input -> on button pressed** block to trigger button presses.

The **on button** **pressed** block can be found under the pink **Input** category. This block allows to to select 3 option from the dropdown namely A, B, A+B which corresponds to each button.

You will use 3 of these blocks. Each for one button
{% endhint %}

## Create your new program

Click on the ***micro:bit*** icon on your toolbar or go to <https://makecode.microbit.org/> on your browser.

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LskXJjPT2bXMIodrtZq%2F-LskcML6iX1eVw_Fa0KA%2F-LskclQv7ySUOW6M71CY%2FMakeCode1.png?alt=media\&token=1464773f-ef91-4b77-b6ed-527e2515a128)

Click on "***New Project***". The MakeCode editor will appear

Delete the **on start** and **forever** blocks by dragging it to the toolbar

![](/files/-Lt6lLB0HMlgU9ta9LJK)

## Show 1 when I press button A

{% hint style="success" %}
Kids task

You will need to program your micro:bit so that when you press button A, the number 1 is displayed
{% endhint %}

Click on the pink **Input** category in the toolbox

![](/files/-Lt6lLB3pjvpUE0fWP6t)

Drag the **on button press** block and move it to your workspace

![](/files/-Lt6lLB5tQjkJNUaKjKw)

Your workspace should look like the image below

![](/files/-Lt6nEMDi9bz4uXs9ubE)

Find the **show string** block under **Basic**

![](/files/-Lt6nEMJaZ9AXF5ZI4sL)

Drag the **show string** block and move it inside the **on button pressed** block&#x20;

Type in **1** in the **show string** block

![](/files/-Lt6lLB7jDy7vsg4KQ7x)

On the simulator side, press the **A button** and you will see 1 display

![](/files/-Lt6lLB84I2t6omtRjfH)

## Show 2 when I press button B

{% hint style="success" %}
Kids task

You will now need to program your micro:bit so that when you press button B, the number 2 is displayed
{% endhint %}

Drag another **on press button** block to your workspace

Click on the drop down by A and you will see 3 options displayed.&#x20;

![](/files/-Lt6lLB9GBao3k8CPMn5)

Select **B** from the dropdown

What this means is that when you press button **B**, something will happen

![](/files/-Lt6lLBAhPj4F8kyhjyU)

Drag a show string block to the **on button button B pressed** code block.

Type **2** in the **show string** code block.

![](/files/-Lt6lLBBKd_MKVrQ9CXc)

On the simulator side, press **button B** and the LED should display 2

![](/files/-Lt6lLBCUaslmLL2qUSE)

## Show 3 when I press button A+B

{% hint style="success" %}
Kids task

Lastly you will now need to program your micro:bit so that when you press button A and button B, the number 3 is displayed
{% endhint %}

Once again, drag the **on button pressed** code block to your workspace

![](/files/-Lt6lLBExbpGzJ--6-Nf)

Select the option A+B from the drop down

![](/files/-Lt6lLBF_MCi9Q-wGBFC)

Drag a **show string** code block to the **on button A+B pressed** code block.&#x20;

Type 3 on in the **show string** code block

![](/files/-Lt6lLBGa-NQRIn_1uAZ)

In the simulator, press the **A+B Button** and the LED should display 3

![](/files/-Lt6lLBH3pfxpgq9BM1m)

## Save, download and run your code

Save you code as **1 2 3** and press save to download.

![](/files/-Lt6lLBIZ5pj3ps2bprU)

Drag your code file named microbit-1-2-3.hex to the MICROBIT(D:) folder to upload your code to your micro:bit.

Test your micro:bit by pressing Button A, then Button B then both button A and button B at the same time.

##
