During boot relay go high
Posted: Thu Mar 21, 2019 7:43 pm
When I reboot my esp32 both relay pins goes high and turns on. (Not Good)
Program works find but the boot is a big problem. I have tried to pull pins high and low. Does not seem to work. Anyone have this problem and knows how to fix.. Thanks
Program works find but the boot is a big problem. I have tried to pull pins high and low. Does not seem to work. Anyone have this problem and knows how to fix.. Thanks
Code: Select all
import machine
from machine import Pin
import time
relay1 = Pin(14, Pin.OUT, machine.Pin.PULL_DOWN)
relay2 = Pin(13, Pin.OUT, machine.Pin.PULL_DOWN)
#relay3 = Pin(12, Pin.OUT, machine.Pin.PULL_DOWN)
#relay4 = Pin(15, Pin.OUT, machine.Pin.PULL_DOWN)
while True:
relay1.value(0) # to switch it off
time.sleep(2)
relay1.value(1) # to switch it on
time.sleep(2)
relay2.value(0) # to switch it off
time.sleep(3)
relay2.value(1) # to switch it on
time.sleep(2)