![header-lesson-00](assets/header-lesson-00.png)

# Running Code on a micro:bit with MakeCode

The code in this section describes how to create your first program. The program displays the text "Hello!" and displays it on the micro:bit display once.

## Selecting and Adding Blocks

Click on the `Basic` section of the Toolbox.

![makecode-first-program-01](assets/makecode-first-program-01.png)

Select the `show string` block. A string is a group of characters that can include letters, numbers, symbols, and even spaces. Strings are mainly used to store text people can read, like words and sentences. They help computer programs communicate information to the person using the program.

![makecode-first-program-02](assets/makecode-first-program-02.png)

Drag the `show string` block into the `on start` block. Pay close attention to the shape of the blocks. They need the same shape to "click" together and make your code work correctly.

![makecode-first-program-03](assets/makecode-first-program-03.gif)

The program is now complete. Click run and watch your micro:bit display your message. Now replace ‘hello’ with another word and run the code. Did it work?

## Handling Unused Blocks

Unused blocks can be moved or deleted. Even if they are empty, unused blocks do not generally affect the program, but moving or deleting unused blocks prevents overlapping blocks and improves the code's readability.

### Moving Unused Blocks

Unused blocks can be selected and moved.

![makecode-first-program-04](assets/makecode-first-program-04.gif)

### Deleting Unused Blocks

Unused blocks can be deleted by dragging them to the left and releasing them on the Toolbox where the purple trash appears.

![makecode-first-program-05](assets/makecode-first-program-05.gif)

Unused blocks can also be deleted by selecting the block and pressing the delete or backspace key on the upper right corner of the keyboard.

![makecode-first-program-06](assets/makecode-first-program-06.gif)

## Downloading Code to the micro:bit

After the `show string` block is placed in the `on start` block, it can be downloaded to the micro:bit. If the micro:bit is not connected, follow the steps in the previous section.

![makecode-first-program-07](assets/makecode-first-program-07.png)

After the "Download" button is pressed, it is downloaded to the micro:bit.

![makecode-first-program-08](assets/makecode-first-program-08.png)

