It’s possible to use the external pins on the micro:bit to control external LEDs.
Electric current can only flow one way through a light emitting diode (LED). It must flow through its anode (+) and out its cathode (-) to light.
The anode has a longer leg and often has a bend in it.
A 220Ω resistor is added to reduce the voltage; without it the LED would blow.
Which Resistor to use with an LED?
A resistor is required to limit the power supplied to an LED. The LED could ‘blow’ if it supplied directly by the microbit. The resistor’s value can be calculated by using the typical forward voltage of the LED. This is usually on the data sheet for the component and looks similiar to this: “2V @ 20mA”.
A rough, conservative estimate is good enough. These are the resistors required when a typical LED is driven by the microbit:
Throughout these pages I’ve used 220Ω resistors because they’re ubiquitous and will cover pretty much every LED. The downside is that LEDs lit with 220Ω resistors will be slightly dimmer than they could be.
To get brighter LEDs, use the resistors mentioned above or be lazy and use 68Ω resistors for everything.