long minRaw = 900000;
 long maxRaw = -900000;
 long rawAdc;

void getCorriente()
{
   rawAdc = analogRead(39);
   if(rawAdc > maxRaw){
    maxRaw = rawAdc;
   }
   if(rawAdc < minRaw){
    minRaw = rawAdc;
   }
 }

void setup()
{
  Serial.begin(115200);
}

void loop(){
getCorriente();
Serial.print(maxRaw);
Serial.print("   ");
Serial.println(minRaw);
delay(500);
}