Micro:Bit — LED

Attach an LED light to your micro:bit

digital write pin

You’ll find the Pins controls under ‘Advanced’ in the micro:bit editor.

‘digital write’ just means ‘turn on or off’:

0 : means ‘off’
1 : means ‘on’

You can use this to turn things like LEDs on and off. Connect them to your micro:bit, and use the digital write block to control them.

Not obvious in the picture: an LED has two legs, one of which is longer than the other. Connect the short leg to the connector on your micro:bit labelled ‘GND’ (the white lead in the photo below).

Challenges

You could try using buttons to turn your LED on or off.

Good to know

  • Your micro:bit has three pins, numbered 0, 1 and 2.
  • There are loads more connectors for bigger projects, but they’re more fiddly to connect to.
  • You can also read from pins.
  • Pins don’t have to be ‘on’ or ‘off’: they can be ‘on just a bit’. See analog read pin and analog write pin in the official documentation.
© Northumbria University 2014-26