 
 String getInputStatusJSON(){
   String array="[";
-  for(int i=0;i<numPin;i++)
+  for(int i=0;i<numInPin;i++)
    { 
     if(digitalRead(input_pins[i])==HIGH)
       array+="1";
     else
       array+="0"; 
-    if(i!=(numPin-1))
+    if(i!=(numInPin-1))
       array+=",";
    }
    array+="]";

    }
    // save the current output state on EEPROM every 10 seconds
    if(millis()-lastTime>10000){
      for(int i=0;i<numPin;i++){
        int address = i/8;
        byte pos = i%8;
        if(digitalRead(output_pins[i])==HIGH){

long lastTime;

void setup() {
  for(int i=0;i<numInPin;i++){
    pinMode(input_pins[i],INPUT);
    
  }
  for(int i=0;i<numOutPin;i++){
    pinMode(output_pins[i],OUTPUT);
    //load the last output state
    int address = i/8;  
    byte pos = i%8;
