Example Code for micro:bit-Start Engine for Preheating
Last revision 2026/01/14
This article offers a comprehensive guide on implementing a preheating engine effect using micro:bit and Maqueen Lite, including hardware setup, software preparation, and sample code for creating a breathing light effect with RGB LEDs.
Hardware Preparation
- Maqueen Lite x1
- micro:bit V1/V2 x1
- MicroUSB cable x1
Software Preparation
- Programming Platform: makecode
- Libraries: maqueen, neopixel
Wiring Diagram
No additional wiring is required except inserting the micro:bit into Maqueen Lite.
Other Preparation Work
- Load MakeCode Graphical Library for Maqueen as described in the previous example.
Sample Code
Code idea: set the color variables R, G, and B of the RGB LED to 0, first gradually increase the values of the variables, then decrease them to show a breathing light effect.
Code URL: https://makecode.microbit.org/_du25LDamJgYs
Code File: maqueen2.hex
Code Screenshot:
Result
The bottom ambient light changes gradually from dim to bright and then back to dim.
Was this article helpful?
