from machine import Pin, PWM
from utime import sleep, sleep_ms 

print("Hello, ESP32!")

Led = Pin(15, Pin.OUT)
Zumbador =  PWM(Pin(2), freq = 440, duty = 512)
Servo = PWM(Pin(21), freq = 30)

for i in range (1800, 8000):
    Servo.duty_u16(i)
    sleep_ms(1)


def sonido (freq, sleep):
    Zumbador.freq(freq)
    Zumbador.duty(512)
    time.sleep(sleep) 
while True:
  Led.value(1)
  sleep(2)
  Led.value(0)
  sleep(2)
  sonido(440, 0.6)
  sonido(300, 0.6)