Guide

3/7/2018 SparkFun Inventor's Kit for micro:bit Experiment Guide - learn.sparkfun.com
https://learn.sparkfun.com/tutorials/sparkfun-inventors-kit-for-microbit-experiment-guide/all#introduction-to-microsoft-makecode 44/63
Unlike the action of most motors that
continuously rotate, a servo motor
can rotate to and hold a specific angle
until it is told to rotate to a different
angle. You can control the angle of
the servo by sending it a PWM (Pulse
Width Modulation) pulse train; the
PWM signal is mapped to a specific
angle from 0 to 180 degrees.
Inside of the servo there is a gearbox connected to a motor that drives the shaft. There is also a potentiometer that gives feedback
on the rotational position of the servo, which is then compared to the incoming PWM signal. The servo adjusts accordingly to
match the two signals.
In this experiment, the servo is powered through 3.3 volts on the red wire and ground on the black wire; the white wire is
connected to pin P0.