Example Code for micro:bit-Adjustable-Speed Fan
Last revision 2026/01/04
This article offers detailed instructions on connecting and programming an adjustable-speed fan using micro:bit, including wiring diagrams and sample code for different programming environments.
Hardware Preparation
Connect the fan module to pin P0 and the rotary knob module to pin P1.
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?


