A servo does not spin 360 degrees like other motors. Instead, a servo allows precise rotation within 180 degrees.

A pulse width modulation (PWM) drives the servo shaft. For example, 2% duty cycle corresponds to 0 degrees and 12% duty cycle corresponds to 180 degrees.

To begin writing the code for the raspberry pi, first we need to import the libraries.

Drag the proper command from the right into the rectangle:

# Import libraries

import time