from time import sleep
from machine import Pin
relay_1 = Pin(2,Pin.OUT,PULL_DOWN)
relay_2 = Pin(3,Pin.OUT,PULL_DOWN)
switch_PIN1 = Pin(28,Pin.OUT,PULL_DOWN)
switch_PIN2 = Pin(27,Pin.OUT,PULL_DOWN)
while True:
state_switch_PIN1 = switch_PIN1.value()
state_switch_PIN2 = switch_PIN2.value()
if state_switch_PIN1 == 1:
relay_1.on()
elif state_switch_PIN1 == 0:
relay_1.off()
if state_switch_PIN2 == 1:
relay_2.on()
elif state_switch_PIN2 == 0:
relay_2.off()
e