Connect a Micro:bit to LED

by Benji45631 in Circuits > Microcontrollers

75 Views, 1 Favorites, 0 Comments

Connect a Micro:bit to LED

microbit.png

This is what you will make. Note: this is a simulator.

Supplies

Screenshot 2026-01-30 175022.png
Screenshot 2026-07-07 145246.png
Screenshot 2026-07-07 145340.png

You will need a micro:bit, a white, blue, or green LED, and crocodile or alligator clips. (it does not matter)

Connecting the Parts

how to connect a white led to a microbit #coding #microbit #led

Connect the micro:bit pins: 0, GND (ground) to the LED using clips (crocodile or alligator clips). Connect the longer leg to pin 0. The shorter leg connects to GND.

WARNING: Make sure the alligator clips do not touch each other on the LED or you can short circuit the micro:bit.

Coding It

Screenshot 2026-07-07 152248.png

Make 2 variables: fading, index and put these blocks in your Microsoft Makecode Editor. Find the "digital write pin " block in the pins.

Coding a Satisfying Fade Effect

Screenshot 2026-07-07 152303.png

These are the blocks for the fading effect.