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

Wiring Diagram

Sample Code

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

Result

Was this article helpful?

TOP