from machine import Pin, PWM
import time
servo = PWM (Pin (15))
servo.freq (50)
while True:
servo.duty_ns (500000)
time. sleep_ms(500)
servo.duty_ns (1500000)
time. sleep_ms(500)
servo.duty_ns (2500000)
time. sleep_ms(500)
servo.duty_ns(1500000)
time. sleep_ms(500)