from time import sleep
from machine import Pin, Timer
def blink1(event):
global state1
state1 = not state1
red.value(state1)
def blink2(event):
global state2
state2 = not state2
green.value(state2)
red = Pin(1, Pin.OUT)
green = Pin(28, Pin.OUT)
state1 = False
state2 = False
Timer(period=200, mode=Timer.PERIODIC, callback=blink1)
Timer(period=300, mode=Timer.PERIODIC, callback=blink2)
for i in range(20):
print(i)
sleep(1)
print('Fertig!')