This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS: HDC1080 (Double To Integer Conversion)

Other Parts Discussed in Thread: HDC1080, CC1310

Tool/software: Code Composer Studio

I am so confused about reading HDC1080. How to get temperature and humidity value as an integer?

MCU is CC1310. My code shown as below.

 

uint16_t temperature;

uint16_t humidity;

.....................................

/* Extract degrees C from the received data */
temperature = rxBuffer[0];
temperature = (temperature<<8);
temperature |= rxBuffer[1];
temperature = (((double)(int16_t)temperature / 65536)*165 - 40)*10;

humidity = rxBuffer[2];
humidity = (humidity<<8);
humidity |= rxBuffer[3];
humidity = ((double)humidity / 65536)*100;