Example Code for micro:bit-Control Servo
This article provides a detailed guide on how to control a servo motor using micro:bit, including hardware preparation, wiring diagrams, Mind+ and MakeCode sample code, and a program flowchart.
Hardware Preparation
![]() |
![]() |
![]() |
|---|---|---|
| BOS0003 Self Locking Switch | SER0045 9g Metal Gear Micro Servo | BOS0035 Mainboard-3IO |
![]() |
![]() |
![]() |
| MBT0039 micro:bit | BOS0040 micro:bit BOSON Expansion Board | BOS0025 Servo Controller Module |
Wiring Diagram
Non-programming Project
Connection Diagram:

Programming Project
Connection Diagram:

Other Preparation Work
Tip: micro:bit and its expansion board will be used in programming projects.
Result
Video Demo
| Non-programming | Programming |
|---|---|
![]() |
![]() |
Additional Information
Program Flowchart:

Was this article helpful?








