float Weather_HeatIndexDegF(void) { int8_t temperature = (int8_t) Weather_getTemperatureDegF(); //Current room temperature in Degrees F int8_t humidity = (int8_t) BME280_getHumidity(); // Humidity in %RH float heatindex = 0; float hi[9] = {-42.379,2.04901523,10.1433127,-0.22475541,-6.83783/1000,- 5.481717/100,1.22874/1000,8.5282/10000,-1.99/1000000}; if ((humidity >= 40) && (temperature >= 80)) { heatindex = hi[0]; heatindex += hi[1] * temperature; heatindex += hi[2] * humidity; heatindex += hi[3] * temperature * humidity; heatindex += hi[4] * temperature * temperature; heatindex += hi[5] * humidity * humidity; heatindex += hi[6] * temperature * temperature * humidity; heatindex += hi[7] * temperature * humidity * humidity; heatindex += hi[8] * temperature * temperature * humidity * humidity; return (int8_t) heatindex; } else { return temperature; } }