from time import sleep
from machine import Pin
led = Pin(1,Pin.OUT)
led2 = Pin(2,Pin.OUT)
knop1 = Pin(3,Pin.IN)
knop2 = Pin(4,Pin.IN)
a = 0
while True:
if knop1.value() == 1:
a=1
c=0
def abc():
if knop2.value()==1:
b = 0
a = 0
elif knop2.value()==0 and c == 0:
b = 1
elif c == 1:
b = 0
return b
while a == 1:
led.value(abc())
led2.value(0)
sleep(0.3)
led.value(0)
led2.value(abc())
sleep(0.3)
led2.value(0)
if knop2.value() == 1:
a = 0