hello there
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | import machine from machine import Timer from machine import Pin #from time import sleep led = machine.Pin(16, machine.Pin.OUT) greenled = machine.Pin(17, machine.Pin.OUT) led25 = machine.Pin("LED", machine.Pin.OUT) #relaypin = Pin(20, Pin.OUT) led.off() led.on() timer=Timer() greenled.off() #rtc = machine.RTC() #rtc.datetime((2024, 10, 18, 2, 4, 33, 0, 0)) # (year, month, day, weekday, hours, minutes, seconds, subseconds) #print(rtc.datetime()) def blink(timer): led25.toggle() #relaypin.value(1) print("0") #sleep(5) #relaypin.value(0) #sleep(5) print("1") timer.init(freq=0.5, mode=Timer.PERIODIC, callback=blink) |