from machine import Pin, PWM
from time import sleep
buzzer = PWM( Pin(15), freq=1250) #choisir la note musicale a jouer en changeant freq du PWM
while True:
buzzer. duty(512) # set the volume by changing the PWM duty value
#choisir volume du buzzer
sleep(1)
buzzer.duty(0) # volume du buzzer = 0
sleep(1)
buzzer.init( freq=2500, duty=512)#choisir la note musicale a jouer en changeant freq du PWM
# set the volume by changing the PWM duty value
#choisir volume du buzzer
sleep(1)
buzzer.duty(0) # volume du buzzer = 0
sleep(1)
buzzer.freq(1250)