# LED control using keys/switch with internal pull_up resistor.
from machine import Pin
led = Pin(5, Pin.OUT)
switch = Pin(27,Pin.IN, Pin.PULL_UP)
while True:
x = switch.value()
if x==0:
led.on()
else:
led.off()
# LED control using keys/switch with internal pull_up resistor.
from machine import Pin
led = Pin(5, Pin.OUT)
switch = Pin(27,Pin.IN, Pin.PULL_UP)
while True:
x = switch.value()
if x==0:
led.on()
else:
led.off()