#Internal PUll UP
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()
#Internal PUll UP
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()