void ReadOutsideTemp(void)
{
uint16_t Temp, Hum;
uint8_t RawTempHum[4];
float fTemp, fHum;
i2c1_readDataBlock(TempHum, TempL, RawTempHum, 4); //read click board
Temp = RawTempHum[1] << 8 | RawTempHum[0];
Hum = RawTempHum[3] << 8 | RawTempHum[2];
//Temp = (Temp / 2^16)*165 - 40;
//Hum = (Hum / 2^16)*100;
fTemp = ((float)Temp / 65536.0) * 165.0 - 40.0;
fHum = ((float)Hum / 65536.0) * 100.0;
if (SysConfigbits.TempFormat == ON) fTemp = (fTemp * 9 / 5) + 32; //change from °C to °F
SysTemp.Out = fTemp; //for lcd display
SysTemp.RH = fHum; //for lcd display
TempDisplay(); //display on LCD
}