In this tutorial we will control the servomotor using the two buttons A and B of the micro: bit: If you press button A, the servomotor positions itself at the 90 ° angle. If you press button B, the servomotor positions itself at the 45 ° angle.
The connection is almost always the same and will be done using 3 wires, the main colors of which you may encounter:
There are several mounting methods.
Here is the makecode program which allows you to control a servomotor using the buttons on the micro: bit card. Note: You must go to Extensions to import the servo extension.