As we’ve seen, the same micro:bit or Climate Action Kit can be used to create all sorts of amazing projects, from a step counter to a tree seeder vehicle. But how does the micro:bit know what to do for each of these projects? The answer lies in the code.
Code is a set of instructions that tells the micro:bit exactly how to behave. You can think of code as the language we use to communicate with computers, in much the same way as we use English or Spanish to talk to each other. By writing code, we can tell the micro:bit exactly how to count steps, track temperature, or even deliver a certain wavelength of light to our plants!
The code instructions we write are like a recipe: each step needs to be carefully ordered to produce the desired result. This step-by-step process is called an algorithm. Whether it’s detecting motion or displaying data, the micro:bit will follow your algorithm, in order, to complete the task at hand.
Code Example
Imagine we want the micro:bit to display a smiley face when the A button is pressed. Here’s how the algorithm for this task might look when written in two different coding languages:
MakeCode Coding Language

Python Coding Language
from microbit import *
while True:
if button_a.is_pressed():
display.show(Image.HAPPY)
Block-based coding, like we’ll be doing in this course, is great for beginners because it’s visual and user-friendly. Text-based coding, like Python, offers more flexibility, but requires precision.
In the next section, we’ll start creating our own block-based algorithms in the MakeCode editor. Get ready to bring your micro:bit to life!