Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KC868-A16 integrate to Node-Red for alexa voice control
#7
such as:
if(pcf8574_I1.digitalRead(P0) == LOW) //key1 pressed
{
delay(20); //anti-interference
if(pcf8574_I1.digitalRead(P0) == LOW) //key1 pressed again
{
pcf8574_R1.digitalWrite(P0,!pcf8574_R1.digitalRead(P0)); // toggle relay1 state
while(pcf8574_I1.digitalRead(P0) == LOW); //wait remove hand
if (pcf8574_R1.digitalRead(P0) == LOW) relay1state= "on"; else relay1state= "off";
}
}
//-------------------------------------------------------------------------------------------------------
you just change every key funtion's "delay(20);" replace 20 with other number will have different time.
Reply


Messages In This Thread
RE: KC868-A16 integrate to Node-Red for alexa voice control - by admin - 10-05-2022, 01:11 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)