from machine import Timer, Pin
def callback_timer (t):
global etat_led
etat_led = not(etat_led)
etat_led = 1
led_1 = Pin(32,Pin.OUT)
led_2 = Pin(33,Pin.OUT)
tim0 = Timer(0)
tim0.init(period=2000, mode=Timer.PERIODIC, callback=callback_timer)
Bouton= Pin(26,Pin.IN,Pin.PULL_UP)
while True:
if Bouton.value()==0 :
led_2.value(1)
else :
led_2.value(0)
led_1.value(etat_led)