from machine import Pin
from time import sleep
Button=Pin(1,Pin.IN,Pin.PULL_UP)
LED=Pin(2,Pin.OUT)
while True:
a=Button.value()
print(a)
if a==0:
LED.value(1)
else:
LED.value(0)from machine import Pin
from time import sleep
Button=Pin(1,Pin.IN,Pin.PULL_UP)
LED=Pin(2,Pin.OUT)
while True:
a=Button.value()
print(a)
if a==0:
LED.value(1)
else:
LED.value(0)