Example Code for micro:bit-Button Fan
Last revision 2025/12/31
This article provides a detailed guide on connecting and programming a button fan using a micro:bit, including hardware setup, software libraries, and sample code for MakeCode and Mind+ environments.
Hardware Preparation
Connect the button module to pin C0 and the fan module to pin C1.
Software Preparation
-
MakeCode User Library Link: click here
-
Mind+ Upload Mode User Library Link: click here
-
Mind+ Python Mode User Library Link: click here
Wiring Diagram

Sample Code
| MakeCode Program ScreenshotProgram Link:click here | Mind+ Program Screenshot |
|---|---|
![]() |
![]() |
Result

Was this article helpful?


