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

Wiring Diagram

Sample Code

MakeCode Program Screenshot
Program Link:click here
Mind+ Program Screenshot

Result

Was this article helpful?

TOP