#Internal Pull Down
from machine import Pin
from time import sleep
led = Pin(5, Pin.OUT)
switch = Pin(27,Pin.IN, Pin.PULL_DOWN)
while True:
x = switch.value()
if x==1:
led.on()
else:
led.off()
#Internal Pull Down
from machine import Pin
from time import sleep
led = Pin(5, Pin.OUT)
switch = Pin(27,Pin.IN, Pin.PULL_DOWN)
while True:
x = switch.value()
if x==1:
led.on()
else:
led.off()