Good day everyone! I´m controlling a bomb through a 5V relay with a digital input. However I notice that at booting the board those pins that are to start LOW are set to HIGH for about 2 seconds and THEN go to LOW. This turns on the bomb and messes everything else in the code. I´ve read that I should put a pulldown resistor to fix that, but so far that hasn´t worked. Any idea what can I do to fix it? Thanks y´all!
void setup(){
pinMode(sensorDeFlujo, INPUT);
Serial.begin(9600);
attachInterrupt(0, flujo, RISING);
interrupts(); // Habilitar interrupciones
tiempoAnterior = millis();
pinMode(pin, OUTPUT);
digitalWrite(pin, estado);
/*while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}*/
Serial.println("Ethernet WebServer Example");
// start the Ethernet connection and the server:
Ethernet.begin(mac, ip);
// Check for Ethernet hardware present
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
Serial.println("Ethernet shield was not found. Sorry, can't run without hardware. :(");
while (true) {
delay(1); // do nothing, no point running without Ethernet hardware
}
}
if (Ethernet.linkStatus() == LinkOFF) {
Serial.println("Ethernet cable is not connected.");
}
// start the server
server.begin();
Serial.print("server is at ");
Serial.println(Ethernet.localIP());
}