frommachineimportPin,PWM,RTCimporttimefromtimeimportsleepimporttm1637importntptimeimportnetworkUTC_OFFSET=0*60*60# change the '0' according to your timezoneactual_time=time.localtime(time.time()+UTC_OFFSET)# Frequency and duration of the soundFREQUENCY=220# HzDURATION=2# seconds# Create a controllable Pin for the speakerspeaker=PWM(Pin(5))tm=tm1637.TM1637(clk=Pin(9),dio=Pin(8))connection=network.WLAN(network.STA_IF)defconnect(ssid,password):ssid=ssidpassword=passwordifconnection.isconnected()==True:print("Already connected")returnconnection.active(True)connection.connect(ssid,password)whileconnection.isconnected()==False:passprint("Connection successful")print(connection.ifconfig())# Function to play a sounddefplay_sound(frequency,duration):speaker.freq(frequency)speaker.duty(512)time.sleep(duration)speaker.duty(0)connect("SSID","password")#Replace the SSID with the name of your network and password with the networks passwordrtc=RTC()alarm=[08,30,1]#The time for the set alarm [hour, minutes, enabled status(1=true)]isPoint=Truewhile(1):printTimeH=int("{3:02d}".format(*actual_time))printTimeM=int("{4:02d}".format(*actual_time))ifalarm[2]==1andalarm[0]==printTimeHandalarm[1]==printTimeM:play_sound(FREQUENCY,DURATION)# Play the soundtm.numbers(printTimeH,printTimeM,isPoint)