from machine import Pin, Timer
import time
led1 = Pin(0, Pin.OUT)
led2 = Pin(1, Pin.OUT)
led3 = Pin(2, Pin.OUT)
led4 = Pin(3, Pin.OUT)
tim1 = Timer()
tim2 = Timer()
tim3 = Timer()
tim4 = Timer()
def tempo1(tim1):
led1.toggle()
def tempo2(tim2):
led2.toggle()
def tempo3(tim3):
led3.toggle()
def tempo4(tim4):
led4.toggle()
tim1.init(period=2000, mode=Timer.PERIODIC, callback=tempo1)
tim2.init(period=1000, mode=Timer.PERIODIC, callback=tempo2)
tim3.init(period=500, mode=Timer.PERIODIC, callback=tempo3)
tim4.init(period=250, mode=Timer.PERIODIC, callback=tempo4)
time.sleep(10)
tim1.deinit()
tim2.deinit()
tim3.deinit()
tim4.deinit()