from machine import Pin
import time
relay = Pin (22,Pin.OUT)
boton = Pin (15,Pin.IN, Pin.PULL_UP)
while True :
lectura = boton.value()
print(lectura)
time.sleep(1)
if lectura == 0 :
relay.value(1)
else:
relay.value(0)
from machine import Pin
import time
relay = Pin (22,Pin.OUT)
boton = Pin (15,Pin.IN, Pin.PULL_UP)
while True :
lectura = boton.value()
print(lectura)
time.sleep(1)
if lectura == 0 :
relay.value(1)
else:
relay.value(0)