Open project · after lesson 2: Commands from the computer
Build both ends of a micro:bit gadget: the micro:bit measures something (light, temperature, movement) and sends it, and your own web page shows it live, changes how it looks when the reading crosses a line you choose, and has a button that sends the micro:bit a command.
The page talks to the micro:bit with microbit.js, which is already in the starter. In this preview it opens a pretend micro:bit (type the lines it would send). For the real thing, download the page and open it in Chrome or Edge with the micro:bit plugged in.

These light up when your code uses them. Click one to see where you learned it.
The micro:bit
The web page
Tick each one when it is true of your project. Nobody marks it: be honest with yourself.
basic.forever(function () {
serial.writeValue("temp", input.temperature())
basic.pause(1000)
})microbit.onValue(function (name, number) {
if (name === "temp") {
document.querySelector("#reading").textContent = number + " °C";document.body.style.background = number > 25 ? "#ffd6d0" : "white";document.querySelector("#alarm").addEventListener("click", function () {
microbit.send("alarm");
});Tick every milestone first.
You built it with: