Smart Home Automation Forum
[Arduino source code for KC868-A2]-02 INPUT - 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]-02 INPUT (/showthread.php?tid=2637)



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

Code:
/*A2 INPUT PIN*/
#define input1  36
#define input2  39

void setup()
{
  Serial.begin(115200);
  pinMode(input1,INPUT);
  pinMode(input2,INPUT);
}

void loop()
{
if (digitalRead(input1)==LOW){
  Serial.println("input1 down");
}
if (digitalRead(input2)==LOW){
  Serial.println("input2 down");
}

}