#led with push btn without resistor will give unaccepted output
from machine import Pin
from time import sleep
led2=Pin(2,Pin.OUT)
btn=Pin(14,Pin.IN)
while True:
if btn.value()==True:
led2.on()
else:
led2.off()
#led with push btn without resistor will give unaccepted output
from machine import Pin
from time import sleep
led2=Pin(2,Pin.OUT)
btn=Pin(14,Pin.IN)
while True:
if btn.value()==True:
led2.on()
else:
led2.off()