       //
          pinhardstate[i] = 1;
          pinsoftstate[i] = 1;
+         pineepromstate[i] = 1;
+         EEPROM.write(eeprom[i], 1);
          pintime[i] = millis();
          }
       else 


//
const int pinc = 4;
const int pins[pinc] = {5,6,7,8}; //physical to logical pin
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};
volatile unsigned long pintime[pinc] = {0,0,0,0};

// the setup routine runs once when you press reset:
void setup() 
{                
   // initialise to internal 20Mom resistor
   for (int i = 0; i < pinc; i++)
      {
   //
