from machine import Pin
from time import sleep
btn=Pin(0,Pin.IN)
led=Pin(1,Pin.OUT)
while(1):
print(btn.value())
if btn.value() == 1 :
led.on()
else:
led.off()
sleep(.5)
from machine import Pin
from time import sleep
btn=Pin(0,Pin.IN)
led=Pin(1,Pin.OUT)
while(1):
print(btn.value())
if btn.value() == 1 :
led.on()
else:
led.off()
sleep(.5)