Capacitive Soil Sensor mapping and online editor

I have been having problems with the mapping function in Arduino online editor. Gemini AI suggests there is not a mapping function. Usually the sensors give approximate values of 550 DRY and 350 WET so mapping these directly would be a calculation like the following: soilMoistureValue = (sensorValue -350) * 100 / (550 - 350); but this still does not yield a percentage..... any suggestions??

That would evaluate to:

soilMoistureValue = (sensorValue -350) * .4;

map() is usually formed like this:

outputValue = map ( inputValue, minInput, maxInput, minOutput, maxOutput);

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.