Example Code for micro:bit-Electric Candle
This guide provides step-by-step instructions for setting up and programming a micro:bit electric candle using an RGB LED strip, including hardware and software preparation, wiring diagrams, and sample code.
Hardware Preparation
![]() |
![]() |
![]() |
|---|---|---|
| M011.00184 RGB LED Strip | MBT0039 Micro:bit | BOS0040 Micro:bit BOSON Expansion Board |
Software Preparation
Before using the colorful light strip, load the library in Mind+. Open the Mind+ programming platform, find the "Extension" in the lower left corner and click it, then click the WS2812 RGB light in the "display" to load the relevant commands. At this time, the display module will appear in the command area. After completing the above steps, connect the light strip to the micro:bit board to control the effect of the light strip through programming.
Wiring Diagram

Other Preparation Work
Flow Chart:

Sample Code
Mind+ Sample Program:
Makecode Sample Program:
Result
Demo Videos:
| Programming |
|---|
![]() |
Was this article helpful?




