The blocks from micro:bit Foundations, each with what it does. Find them in the MakeCode toolbox; the picture shows the block, the code is the same block as MakeCode JavaScript.
Print a cheat sheet (the whole course or one unit, with a picture of each block)
basic.showIcon(IconNames.Heart)
Shows a ready-made picture. Basic › show icon; click the picture to choose another.

id: show-icon
basic.showLeds(`
. # . # .
# # # # #
# # # # #
. # # # .
. . # . .
`)
Draw your own picture: click squares to light them (# is on). Basic › show leds.

id: show-leds
basic.showString("Hello")
Scrolls a word or message across the screen. Basic › show string.

id: show-string
basic.showNumber(0)
Shows a number; numbers above 9 scroll. Basic › show number.

id: show-number
basic.showArrow(ArrowNames.West)
Shows an arrow pointing a direction. Basic › more › show arrow.

id: show-arrow
basic.clearScreen()
Turns every LED off. Basic › more › clear screen.

id: clear-screen
basic.pause(500)
Waits before the next block. 1000 ms is one second. Basic › pause.

id: pause
basic.forever(function () {
blocks
})
Runs the blocks inside again and again. Blocks in on start run only once.

id: forever
basic.forever(function () {
basic.showIcon(IconNames.Heart)
basic.pause(500)
basic.showIcon(IconNames.SmallHeart)
basic.pause(500)
})
Pictures inside forever repeat, in order. Each pause holds the picture before it.

id: animation
input.onButtonPressed(Button.A, function () {
blocks
})
Runs the blocks inside every time the button is pressed. Choose A, B or A+B. Input.

id: on-button-pressed
input.onGesture(Gesture.Shake, function () {
blocks
})
Runs the blocks inside every time the micro:bit is shaken (or tilted, if you choose another gesture). Input.

id: on-shake
let count = 0
Puts a value in a variable, throwing the old value away. Make the variable in Variables first.

id: set-variable
count += 1
Adds to a variable's value. Change by -1 counts down. Variables.

id: change-variable
let count = 0
input.onButtonPressed(Button.A, function () {
count += 1
basic.showNumber(count)
})
Set the start value once, in on start. change adds to whatever the variable holds now.

id: counter
input.lightLevel()
How bright it is: 0 (dark) to 255 (bright). Input.

id: light-level
input.temperature()
How warm it is, in degrees Celsius. Input.

id: temperature
input.acceleration(Dimension.X)
Tilt: x is left (below 0) and right (above 0), y is forward and back. Input › more.

id: acceleration
led.plotBarGraph(value, 255)
Lights more LEDs for a bigger value. The second number is the biggest value. Led.

id: plot-bar-graph
if (condition) {
blocks
}
Runs the blocks inside only when the condition is true; does nothing when it is false. Logic.

id: if
if (condition) {
blocks
} else {
blocks
}
Exactly one part runs: the first when the condition is true, else the second. Click + on an if block.

id: if-else
} else if (condition) {
Another question, asked only if the ones above were false. The first true one wins.

id: else-if
let answers = ["Yes", "No"]
Many values in order under one name. Places start at 0. Advanced › Arrays.

id: list
answers[0]
The item at a place in the list, counted from 0. Arrays.

id: get-value-at
answers.length
How many items are in the list. The last place is the length − 1. Arrays.

id: length-of-list
randint(0, 10)
A random whole number from the first to the second, both included. Math.

id: pick-random
basic.showString(list[randint(0, list.length - 1)])
A random place from 0 to length − 1 reaches every item, however long the list grows.

id: pick-from-list
function name () {
blocks
}
A named job. Making it does not run it: a call block runs it. Advanced › Functions.

id: function
function showScore (points: number) {
blocks
}
A function with an input. Call it with a value: showScore(5). Functions › Add a parameter.

id: function-with-a-parameter
radio.setGroup(1)
Picks a channel (0 to 255). Only micro:bits in the same group hear each other. Radio.

id: radio-set-group
radio.sendNumber(0)
Sends a number to every other micro:bit in the group. Radio.

id: radio-send-number
radio.onReceivedNumber(function (receivedNumber) {
blocks
})
Runs each time a number arrives; receivedNumber holds it. Radio.

id: on-radio-received
radio.onReceivedNumber(function (receivedNumber) {
if (receivedNumber == 1) {
blocks
} else if (receivedNumber == 2) {
blocks
}
})
One on radio received gets every message; receivedNumber says which one arrived.

id: which-message
let words = ["Hi", "Yes", "No"]
radio.onReceivedNumber(function (receivedNumber) {
basic.showString(words[receivedNumber])
})
Send a place number; both micro:bits must hold the same list in the same order.

id: shared-code
radio.sendString("hi")
Sends a word to every other micro:bit in the group. Radio.

id: radio-send-string
radio.onReceivedString(function (receivedString) {
blocks
})
Runs each time a word arrives; receivedString holds it. Radio.

id: on-radio-received-string
input.runningTime()
Milliseconds since the micro:bit switched on. Take one from a later one to time something. Input › more.

id: running-time
start = input.runningTime()
basic.showNumber(input.runningTime() - start)
Store running time at the start; later, running time − start is how long it took (ms).

id: time-it
waiting = true
A variable can hold true or false, to remember what is happening now. Logic.

id: true-or-false
serial.writeValue("light", input.lightLevel())
Sends a line such as light:128 down the USB cable. The board graphs it; MakeCode's simulator shows it under Show data. Serial.

id: serial-write-value
serial.writeLine("ok")
Sends a line of text down the USB cable. Serial.

id: serial-write-line
serial.onDataReceived(serial.delimiters(Delimiters.NewLine), function () {
blocks
})
Runs each time a whole line arrives over USB (it ends with a new line). Serial.

id: on-serial-data-received
serial.readLine()
The line that arrived, as text, without its new line. Use it inside on serial data received. Serial.

id: serial-read-line
radio.sendValue("bin", 1)
Sends a name and a number by radio, such as bin and 1. Radio.

id: radio-send-value
radio.onReceivedValue(function (name, value) {
blocks
})
Runs each time a name and number arrive by radio. Radio.

id: on-radio-received-value
pins.servoWritePin(AnalogPin.P0, 90)
Turns a servo on that pin to an angle from 0 to 180 (90 is the middle). Pins.

id: servo-write-pin
for (let index = 0; index <= 4; index++) {
blocks
}
Runs the blocks inside once for each number from 0 up to the last one, with index set to that number each time. Loops.

id: for-index
message.charAt(0)
The letter at a place in a text. Places start at 0, as in a list. Text (char from … at).

id: letter-at
alphabet.indexOf(letter)
The place where something first appears in a text, counted from 0, or -1 if it is not there. Text (find index of … in …).

id: find-in-text
message.length
How many letters (and spaces) a text has. The last letter is at place length − 1. Text.

id: length-of-text
result = letter + result
Joins two texts, one after the other: "AB" + "C" is "ABC". Text (join).

id: join
place % 26
What is left over after dividing: 27 % 26 is 1. Wraps a count back round to the start. Math (remainder of … ÷ …).

id: remainder
message ^ key
XOR: compares two numbers bit by bit. Doing it again with the same key brings the number back, so one key locks and unlocks. Written ^ in JavaScript and Python.

id: xor-with-a-key