from machine import Pin
led = Pin(5, Pin.OUT)
switch = Pin(27,Pin.IN)
while True:
x = switch.value()
if x==1:
led.on()
else:
led.off()
from machine import Pin
led = Pin(5, Pin.OUT)
switch = Pin(27,Pin.IN)
while True:
x = switch.value()
if x==1:
led.on()
else:
led.off()