#LED control using external switch
from machine import Pin
from time import sleep
led = Pin(2, Pin.OUT)
button = Pin(14, Pin.IN, Pin.PULL_DOWN)
while True:
logic = button.value()
if logic == True:
led.on()
else:
led.off()