 
 void drawCurve(byte numberArray)
 { 
-  float mappedValueVin;
-  byte testNumberArray;
-  
-  mappedValueVin=map(Vin,0,maxControllerVoltage, 0, 35);
-  u8g.drawPixel(60 - mappedValueVin, numberArray);  
+  u8g.setColorIndex(1);
+  u8g.drawPixel(5 + numberArray, 60 - curveTab[numberArray]);  
+  u8g.setColorIndex(255);  
 }
 
 void drawBatteryLimit(void)
 { 
-  
-  //char positionX;
- // bool test =0;
+  char i;
   float mappedVinMax;
-  mappedVinMax=map(VinMax,0,maxControllerVoltage, 0, 22);
-  u8g.setColorIndex(128);
-  u8g.drawHLine(5, 60 - mappedVinMax , 120);
+  mappedVinMax=map(VinMax,0,maxControllerVoltage, 0, 25);
+  u8g.drawHLine(5, 60 - mappedVinMax, 120);
+  u8g.setColorIndex(0);
+  for (i = 5 ; i < 124; i = i +2)
+  {
+    u8g.drawPixel(i , 60 - mappedVinMax );
+  }
   u8g.setColorIndex(255);
 }
 

  
}

/***************************************************
*  Name:        enterSleep
*
*  Returns:     Nothing.
*
*  Parameters:  None.
*
*  Description: Enters the arduino into sleep mode.
*
***************************************************/
void enterSleepArduino(void)
{
  set_sleep_mode(SLEEP_MODE_IDLE);   /* EDIT: could also use SLEEP_MODE_PWR_DOWN for lowest power consumption. */
  sleep_enable();
  
  /* Now enter sleep mode. */
  sleep_mode();
  
  /* The program will continue from here after the WDT timeout*/
  sleep_disable(); /* First thing to do is disable sleep. */
  
  /* Re-enable the peripherals. */
  power_all_enable();
}


float hysteresis ;                           // Value of the hysteresis
float setpointHigh = (VinMax + hysteresis);  // Set setpointHigh Caution the battery may go beyond the overcharge
float setpointLow = (VinMax - hysteresis) ;  // Set setpointLow
unsigned int times;                          // Defines the time between two points when drawing the curve
unsigned char cpt =0;

int limitOverchargeInAnalog;                 // Limit of the overcharge in analog value
int limitSetpointHighInAnalog;               // Limit of the setpointhigh in analog value
