Example Code for micro:bit-Makecode RGB Palette

Last revision 2025/12/09

This article offers an example code and comprehensive guide for creating an RGB palette using micro:bit and MakeCode, enabling users to mix colors with an RGB LED ring through practical hardware and software instructions.

Hardware Preparation

  • micro:bit × 1
  • IO Expansion Board × 1
  • RGB LED Ring- 12 LED beads × 1
  • Analog Rotation Sensor × 3

Software Preparation

Click the extensions in MakeCode and add the lamp strip library into the extensions.

Wiring Diagram

Other Preparation Work

Click the extensions in MakeCode and add the lamp strip library into the extensions.

Sample Code

Result

Let the RGB ring serve as a color palette to mix different colors based on the RGB color model.

Was this article helpful?

TOP