Example Code for micro:bit-Control the Circular Light via Key A, B
Turn on the power, then 24 RGB LEDs display some colors randomly in the beginning. When key A is pressed, executing the waterfall light mode once; When B is pressed, the circular light refreshes the color in every 20ms, and there are 7 colors at all.
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: Control the Annular Light via Key A, B



Result
- Power on: 24 RGB LEDs display colors randomly.
- Press key A: Executes waterfall light mode once.
- Press key B: Circular light refreshes color every 20ms (7 colors total).

Was this article helpful?
