       //
          pinhardstate[i] = 1;
          pinsoftstate[i] = 1;
-         pineepromstate[i] = 1;
-         EEPROM.write(eeprom[i], 1);
-         pintime[i] = millis();
          }
       else 
          if (state==HIGH && pinhardstate[i]==1) // ...button up
             {
          //
             pinhardstate[i] = 0;
-            pintime[i] = millis() - pintime[i];
             }
       }
 }

   server.begin();
}

// the loop routine runs over and over again forever:
void loop() 
{
//   
   for (int i = 0; i < pinc; i++)
      {
   //
      //анализ pinsoftstate? без pinreport? где сообщать клиенту?
      if (pinhardstate[i] == 1 && pinsoftstate[i]==1 && pinreport[i]==0)
         {
      //
         server.println();
         server.print("pin down["); server.print(i, DEC); server.print("]");
            
         pinreport[i] = 1;
         }
      else
         if (pinhardstate[i] == 0 && pinsoftstate[i]==1 && pinreport[i]==1)
            {
         //
            server.println();
            server.print("pintime["); server.print(i, DEC); server.print("]="); server.print(pintime[i], DEC);
            
            pinsoftstate[i] = 0;
            pinreport[i] = 0;
            }
      }
}

const int pins[pinc] = {5,6,7,8}; //physical to logical pin address
const int eeprom[pinc] = {0,1,2,3}; //pin address in eeprom

volatile int pinhardstate[pinc] = {0,0,0,0};
volatile int pinsoftstate[pinc] = {0,0,0,0};
int pineepromstate[pinc] = {0,0,0,0};
int pinreport[pinc] = {0,0,0,0};

byte mac[] = {0x02, 0x80, 0xC2, 0x00, 0x00, 0x01};
