#LED switch using External Resistor(pulldown)
from machine import Pin
led=Pin(2,Pin.OUT)
switch=Pin(14,Pin.IN) 
while True:
    if switch.value()==1:
        led.on()     
    else:
        led.off()
        #LED switch using External Resistor(pulldown)
from machine import Pin
led=Pin(2,Pin.OUT)
switch=Pin(14,Pin.IN) 
while True:
    if switch.value()==1:
        led.on()     
    else:
        led.off()