The function that transforms adc readings into RH % is listed below :
int Read_RH(int pin , int temperature){
int temp_compensated_RH=0;
int RH=0;
float Vcc=5.0;
float Vout=0;
Vout=analogRead(pin)*(3.0/1023); // transforming adc readings into voltage values;
RH=((Vout/Vcc) - 0.16)/0.0062; // RH formula for T= 25 Celsius - derived from HIH-4000-001 datasheet;
temp_compensated_RH=RH/(1.0546-(0.00216*temperature)); // temperature compensation acording to HIH-4000-001 datasheet ;
return temp_compensated_RH;
}
But when I call