Wire parts to a micro:bit's pins: a complete loop, a resistor to protect an LED, a button as an input, and a sensor that gives a number. Each idea is tried on a board first, then built for real in Tinkercad Circuits. Builds on micro:bit Foundations.
A complete loop, and a resistor to keep the current safe.
Current only flows around a complete loop: out of pin 0, through the resistor and the LED, and back to GND. Break the loop anywhere, or turn the LED round, and the current stops everywhere at once.
With no resistor, far too much current flows and the LED is damaged. A resistor limits the current: current = voltage ÷ resistance (Ohm's law). Bigger resistor, less current. In a single loop it works on either side of the LED.
A button as an input, and a sensor that gives a number.
A pin set as an input reads the voltage on it: joined to 3V it reads 1, joined to GND it reads 0. A button joins pin 0 to 3V only while it is held, so a pull-down resistor holds the pin at 0 when it is up. Without one the pin floats and reads 0 or 1 at random.
Analog read turns the voltage on a pin, 0 to 3.3 V, into a number from 0 to 1023. A knob or a light sensor in a divider changes that voltage, so the number changes. A program compares the number with a threshold to decide, as a night light does.
Progress is saved in this browser only. Nothing is sent anywhere.
For teachers: Teacher guide (notes, answers, solutions, slides and worksheets)