#blink led by using push button
from machine import Pin
from time import sleep
button=Pin(14,Pin.IN,Pin.PULL_UP)
pins=[2]
def blinkfun(gled):
if not button.value():
print("Button Pressed!")
gled.on()
else:
print("Button not pressed")
gled.off()
while True:
for led in pins:
ldy=Pin(led,Pin.OUT)
blinkfun(ldy)