← Reference

Decide: cheat sheet

micro:bit Foundations · Find each block in the MakeCode toolbox (the category is at the end of each line).

acceleration

Tilt: x is left (below 0) and right (above 0), y is forward and back. Input › more.

input.acceleration(Dimension.X)
The block

if else

Exactly one part runs: the first when the condition is true, else the second. Click + on an if block.

if (condition) {
    blocks
} else {
    blocks
}
The block

if

Runs the blocks inside only when the condition is true; does nothing when it is false. Logic.

if (condition) {
    blocks
}
The block

else if

Another question, asked only if the ones above were false. The first true one wins.

} else if (condition) {
The block