voidCCS811::setInTempHum(floattemperature,floathumidity)// compensate for temperature and relative humidity
{
int_temp,_rh;
if(temperature>0)
_temp=(int)temperature+0.5;// this will round off the floating point to the nearest integer value
elseif(temperature<0)// account for negative temperatures
_temp=(int)temperature-0.5;
_temp=_temp+25;// temperature high byte is stored as T+25°C in the sensor's memory so the value of byte is positive
_rh=(int)humidity+0.5;// this will round off the floating point to the nearest integer value
uint8_tenvData[4];
envData[0]=_rh<<1;// shift the binary number to left by 1. This is stored as a 7-bit value
envData[1]=0;// most significant fractional bit. Using 0 here - gives us accuracy of +/-1%. Current firmware (2016) only supports fractional increments of 0.5