from machine import Pin
from time import sleep
l = Pin(15,Pin.OUT)
B = Pin(16,Pin.IN)
while True:
logic = B.value()
if logic == True:
l.value(1)
else: l.value(0)
from machine import Pin
from time import sleep
l = Pin(15,Pin.OUT)
B = Pin(16,Pin.IN)
while True:
logic = B.value()
if logic == True:
l.value(1)
else: l.value(0)