from machine import Pin
import time
led1 = Pin(1, Pin.OUT)
led2 = Pin(2, Pin.OUT)
led3 = Pin(3, Pin.OUT)
b1 = Pin(4, Pin.IN, Pin.PULL_UP)
b2 = Pin(5, Pin.IN, Pin.PULL_UP)
b3 = Pin(6, Pin.IN, Pin.PULL_UP)
while True:
if b1.value()==0:
led1.value(1)
else:
led1.value(0)
if b2.value()==0:
time.sleep(0.2)
led2.toggle()
if b3.value() ==0:
time.sleep(0.2)
led1.toggle()
led2.toggle()
led3.toggle()