Home Code Some temperature functions

# Some temperature functions

In previous examples we have had various temperature sensors, most of these will display the humidity and the temperature in celsius but it is easy with a few calculations to add support for other useful data

these should be self explanatory

Code

The kelvin is a unit of measure for temperature based upon an absolute scale. It is one of the seven base units in the International System of Units and is assigned the unit symbol K

In simple terms, the dew point (dew point temperature or dewpoint) is the temperature at which a given concentration of water vapor in air will form dew. More specifically it is a measure of atmospheric moisture.

 Source code               ```// dewPoint function NOAA
double dewPoint(double celsius, double humidity)
{
double A0= 373.15/(273.15 + celsius);
double SUM = -7.90298 * (A0-1);
SUM += 5.02808 * log10(A0);
SUM += -1.3816e-7 * (pow(10, (11.344*(1-1/A0)))-1) ;
SUM += 8.1328e-3 * (pow(10,(-3.49149*(A0-1)))-1) ;
SUM += log10(1013.246);
double VP = pow(10, SUM-3) * humidity;
double T = log(VP/0.61078); // temp var
return (241.88 * T) / (17.558-T);
}```