Example Code for micro:bit-Sound Control Circular Light
Light up 24 RGB LEDs in sequence according to the size of the detected sound, forming a gradual pulsating light ring.
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: The Graphical Programming of Voice Control Circular Light
Result
The 24 RGB LEDs light up in sequence according to the size of the detected sound, forming a gradual pulsating light ring.

Additional Information
By modifying the "Map" to change the relationship between sound intensity and the number of alight leds. 0~300 represents the range of sound; 0~23 represents 24 RGB LEDs.
Was this article helpful?
