The second link is mine
The errors has to do with Arduino 1.0 compability. In the readCalib routine, change every "Wire.send()" and "Wire.receive()" to "Wire.write()" and "Wire.read()"
hi phermansson.
i noticed that you do not connect fout to pin 5
i am curious as to how you work out the freq to obtain final RH%
(by the way, does fout stand for frequency output?)
phermansson:
The errors has to do with Arduino 1.0 compability. In the readCalib routine, change every "Wire.send()" and "Wire.receive()" to "Wire.write()" and "Wire.read()"
Oh, thank you very much, the code work. I'll try with the sensor thursday! ( i can't test it before )
I finally use the code of Tushev and when i launch the code, my Humidity displays a result between -7 and +7.
I followed the advice of robtillaart in this topic:
robtillaart:
OK, question arises if you need to read the Sensitivity and Offset every time? If not keeping those two numbers in memory makes the code a bit simpler. You just request them once in setup().
Furthermore it is not clear from the spec if Sensitivity and Offset are signed or unsigned integers. Looking at the values it seems not relevant but when multiplying all those ints one may get an overflow which causes errors. Better make the vars unsigned long to prevent this.
Rob
So i changed variables int "freq", "offset" and "sens" to unsigned long.
Now i have a consistent result.
PS: I use a MEGA 2560 and the pin FOUT go in Digital Pin 47, not in Digital pin 5.