Example Code for micro:bit-Breathing Light
24 RGB LEDs light up red at the same time, the brightness changes from weak to strong in loop, like breathing.
Hardware Preparation
- micro:bit main board ×1
- ROB0150 24 RGB LEDs Circular Expansion Board ×1
(Purchase Link) - USB cable ×1
Software Preparation
-
Development Tool:
MakeCode
https://makecode.microbit.org -
Add the Neopixel Software Package
Load the neopixel library to control the LED ring.
Other Preparation Work
Add the neopixel software package (loading the lamp ring library) in Makecode; the steps are as follows:

Sample Code
Click and enter the graphic programming:Breathing Light
Result
24 RGB LEDs light up red simultaneously, with brightness cycling from weak to strong like breathing.

Was this article helpful?
