     i+=1;
   }
   Wire.endTransmission();
+  //Serial.println(String(data));
   return String(data);
 }

  //Serial.print("Ph:");
  //Serial.println(pH_data);
  if (isdigit(pH_data[0])) {
    String(pH_data).toFloat();
    if(ph == 0)
      ph = String(pH_data).toFloat();
    else
      ph = (ph + String(pH_data).toFloat()) / 2;
  }
}


  Particle.variable("pH", ph);
  Particle.variable("ORP", orp);
  Particle.variable("soc", soc);
  Particle.variable("calibrating",calibrationmode);
  Particle.function("switchmode",switchcalibrationmode);
  Particle.function("calibratePh",calibrate_ph);
  Particle.function("calibrateORP",calibrate_orp);
  Particle.function("check",check_calibrated);
  Particle.function("measure",measure);
  Particle.function("slope",check_slope);
  Particle.variable("wifi",wifi);

