Example Code for micro:bit-Motor Control
Last revision 2026/01/04
This article offers a comprehensive guide on using micro:bit to control motors, featuring example code, hardware and software preparation, and wiring diagrams for effective motor management.
Hardware Preparation
Connect two motors to pins M1 and M2, respectively.
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?


