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