Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KC868-A16 integrate to Node-Red for alexa voice control
#6
(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);}
Reply


Messages In This Thread
RE: KC868-A16 integrate to Node-Red for alexa voice control - by davesmithr1 - 10-05-2022, 11:32 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)