void setup()
{
Serial.begin(115200);
gravityTds.setPin(TdsSensorPin);
gravityTds.setAref(5.0); //reference voltage on ADC, default 5.0V on Arduino UNO
gravityTds.setAdcRange(1024); //1024 for 10bit ADC;4096 for 12bit ADC
gravityTds.begin(); //initialization
}
void loop()
{
gravityTds.setTemperature(temperature); // set the temperature
gravityTds.update(); //sample and calculate
tdsValue = gravityTds.getTdsValue(); // then get the value
Serial.print(tdsValue,0);
Serial.println("ppm");
delay(1000);
}
I haven't added a temperature compensation yet but still, if I run this code the serial monitor shows "ovf" when submerged.
what could be the problem with this??
please help.
Although, I'd recommend only having one variable definition / initialization per line. Avoid the Comma Operator until you know what you're doing. Then, don't use it.