Smart Home Automation Forum
[Arduino source code for KC868-A2]-04 RELAY - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20)
+--- Forum: KC868-A2 (https://www.kincony.com/forum/forumdisplay.php?fid=43)
+--- Thread: [Arduino source code for KC868-A2]-04 RELAY (/showthread.php?tid=2639)



[Arduino source code for KC868-A2]-04 RELAY - KinCony Support - 03-02-2023

Code:
/*KC868-A2  relay  output*/
#define RELAY1 2
#define RELAY2 15
void setup() {

  pinMode(RELAY1, OUTPUT);
  pinMode(RELAY2, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
    digitalWrite(RELAY1, HIGH);
    delay(1000);
    digitalWrite(RELAY1, LOW);
    delay(1000);
    digitalWrite(RELAY2, HIGH);
    delay(1000);
    digitalWrite(RELAY2, LOW);
    delay(1000);
  

}