   
 }
 
-bool verificationSetpointHigh(int sensorValue, float setpointHigh)                           // Check if sensorValue is higher than setpointHigh
-{
+bool verificationSetpointHigh(int sensorValue, float setpointHigh, float maxControllerVoltage, int & limitSetpointHighInAnalog)                           // Check if sensorValue is higher than setpointHigh
+{
+  float limitSetpointHighInVolt;
   limitSetpointHighInVolt = setpointHigh ;
   limitSetpointHighInAnalog = 1024 * ( limitSetpointHighInVolt / maxControllerVoltage) ;
   


volatile int f_wdt=1;                                             // Sleep arduino

long posit = 0;                                                   // This value will be the previous value of the position of the rotary encoder

const int analogInPinV = A0;                 // Analog input pin that the potentiometer (Voltmeter) is attached to / Default = A0
const int analogInPinA = A1;                 // Analog input pin that the potentiometer (Ammeter) is attached to / Default = A1
const int buttonC = 4;                       // Digital input pin that the button of the rotary encoder is attached to / Default = 4

char selection = 0;                          // Choose true for PWM, false for no PWM
const int  overchargeIndicatorLed = 5;       // LedOutput  Default = 2

float VinMax;                                // Maximum Input Voltage Default = 4
unsigned int R1;                             // Bottom resistance Kohm Default = 10
unsigned int R2 ;                            // top resistance Kohm     Default = 100
float maxControllerVoltage ;                 // the arduino Uno boardcard cant excess 5 volt   default = 5v

  }
}

bool verificationSetpointLow(int sensorValue, float setpointLow, float maxControllerVoltage, int & limitSetpointLowInAnalog)                             // Check if sensorValue is lower than setpointLow
{
  float limitSetpointLowInVolt;
  limitSetpointLowInVolt = setpointLow; 
  limitSetpointLowInAnalog = 1024 * ( limitSetpointLowInVolt / maxControllerVoltage) ;
  
