10-05-2022, 11:32 AM
(10-05-2022, 11:15 AM)admin Wrote: 0.5 second or 10 seconds, just modify the arduino IDE code key function. you can check with source code that we already uploaded.
what would be written to turn a relay on as you hold in an input e.g relay 1 on when button 1 is on, relay 1 off when button 1 is off, i am guessing it is in this text? thanks
// turns 32 relays on and off
if (header.indexOf("GET /1/on") >= 0) {relay1state = "on";pcf8574_R1.digitalWrite(P0, LOW);}
else if (header.indexOf("GET /1/off") >= 0) {relay1state = "off";pcf8574_R1.digitalWrite(P0, HIGH);}
else if (header.indexOf("GET /2/on") >= 0) {relay2state = "on";pcf8574_R1.digitalWrite(P1, LOW);}
else if (header.indexOf("GET /2/off") >= 0) {relay2state = "off";pcf8574_R1.digitalWrite(P1, HIGH);}
else if (header.indexOf("GET /3/on") >= 0) {relay3state = "on";pcf8574_R1.digitalWrite(P2, LOW);}