Example Code for micro:bit-Colorful Waterfall Light
Last revision 2025/12/31
This article provides instructions and code to create a colorful waterfall light effect with micro:bit using Makecode graphical programming, detailing hardware and software preparations, wiring diagrams, and sample code for vibrant LED displays.
Hardware Preparation
- Math & Automatic expansion board for micro:bit, Quantity: 1
- micro:bit, Quantity: 1
Software Preparation
Makecode graphical programming, Mind+ platform.
Makecode Library Address.
About how to install a software library?
Wiring Diagram
No specific wiring required (touch keys are integrated on the board).
Other Preparation Work
Install the Makecode library from https://github.com/DFRobot/pxt-Math-Automatic.
About how to install a software library?
Sample Code

Waterfall Light Code Download
Result
At first, RGB LEDs of the first row light up in different colors from left to right in turn, when all LEDs turn on, make them go off orderly from the first row. After that, RGB LEDs of the first column light up in various color from top to bottom in turn, and then dies off from bottom to top. LEDs of each column turns on repeatedly in the preset order.
Was this article helpful?
