   delay(100);
 
   for (int i=0;i<sensor_SIZE;i++){
-
     A_Values[i] = 1023-analogRead(sensorPins[i][0]); //Attention à corriger ça
   }
 

  Serial.println();
#endif

  delay((unsigned long)15*60*1000 - 2*timeWithCurrent); // 15 min de pause
}

void requestEvent()
{
  int bufferSize = sizeof(int)*(sensor_SIZE)+sizeof(long);
  byte buffer[bufferSize];



const int sensorPins[][2] = {
  {
    A0,4                        }
  ,{
    A1,3                        }
  ,{
    A2,2                        }
  ,{
    A3,1                        }
};

const int sensor_SIZE = ARRAY_LENGTH(sensorPins);
unsigned int A_Values[sensor_SIZE];
unsigned long A_values_timestamp = 0;

volatile unsigned long A_Values_Period = 1000;
volatile int last_command = 0;

#define COMMAND_READ_SENSORS 0
#define COMMAND_SET_ADRESS 1
#define COMMAND_SET_PERIOD 2
#define COMMAND_GET_PERIOD 3

void setup()
{  
  
#ifdef LOG_SERIAL
  Serial.begin(9600);
#endif

  A_Values_Period = readLongFromEEPROM(1);

#ifndef HARDCODEDADRESS
  i2cAdress = readLongFromEEPROM(5);
  if (i2cAdress < 3 || i2cAdress > 77)
    i2cAdress = 3;
  Wire.begin(i2cAdress);
#else
  Wire.begin(HARDCODEDADRESS);
#endif


  Wire.onReceive(receiveEvent);
  Wire.onRequest(requestEvent);

}

void loop()
{
#ifdef FAKESENSORSWITHCOUNTERS

  A_Values[0] = millis();
  A_Values[1] = millis()/1000;      //seconds
  A_Values[2] = millis()/1000/60;   //minutes
  A_Values[3] = millis()/1000/60/60;//hours

  A_values_timestamp = millis();

#ifdef LOG_SERIAL
  for (int i=0;i<sensor_SIZE;i++){
    Serial.print(A_Values[i]);    
    Serial.print("|");
  }
    Serial.println("-------------------------------------");

#endif
  delay(A_Values_Period);

#else
  for (int i=0;i<sensor_SIZE;i++){

    pinMode(sensorPins[i][0], INPUT_PULLUP);
