from machine import Pin
from servo import Servo
from time import sleep

p21 = Pin(21)

s21 = Servo(p21, freq=50, min_us=500, max_us=2500,
                 degrees=270)

while True:
    print("Position: 0")
    s21.position(degrees=0)
    sleep(2)
    print("Position: 30")
    s21.position(degrees=30)
    sleep(2)
    print("Position: 60")
    s21.position(degrees=60)
    sleep(2)
    print("Position: 90")
    s21.position(degrees=90)
    sleep(2)
    print("Position: 120")
    s21.position(degrees=120)
    sleep(2)
