Anyone got hemidex (heat index) code that I could add to my project? I'm using a DHT11 for my temp. and humidity.
I know there is hemidex code out there, but it is all integrated into other projects and I don't know what I need to pull out (i.e. what is needed to calculate hemidex). Currently, I'm able to display the temperature in both C and F, the humidty and the dewpoint to my LCD shield. I'd like to be able to add hemidex.
I'd actually like to be able to use the hemidex values rather than the temp values for other commands.
robtillaart, thanks for the help making the code smaller and faster.
I'm developing a simple on-board automotive computer and the shinking of the formula is of great help.
the approximation version can even be made faster by using integer math only (as possible)
not tested but it would be something like this. (used g2tec consts to get the integer values * 1024)
int heatIndexFast(int T, int R)
{
long c1 = -43396, c2 = 2098, c3 = 10387, c4 = -230; // consts multiplied by 1024
long A = c2 * T + c1; // so A is x 1024
long B = (c4 * T + c3) * R; // and B too
return (A + B + 512) / 1024; // division becomes a shift; +512 is for rounding
}
disclaimer not tested if removing all the higher order elements gives the same (enough) output.