Question
How do I verify if my hts221 sensor is giving the correct value and my calculations ?
I am using the hts221 with i2c protocol for doing my calculation based on this reference:Application note for calculating relative humidity.

Observations:
- So I tried to read the respective registers and do the calculations as per the datasheet, with assigning s16(H_OUT,H0_TOUT,H1_TOUT) and u16(H0_rH_x2,H1_rH_x2) values and I got a negative value as relative humidity along with -ve values for H_OUT and H0_TOUT(Both of them were defined as s16 type).
- But when I switched everything to uint16, which is in contrast to the datasheet, I got a relative humidity of 36% which is ideal and real time value inside a home.
I am wondering why this strange behavior occurs and is there something, I am doing wrong over here?
Al l am doing is reading the respective registers and assigning the values like this(eg: here H_OUT):
uint16_t h_out_res=((uint16_t)hum_reading[1]<<8)|(uint16_t)hum_reading[0];
