it doesnt matter how long I wait. Whether I query the arduino twice immediately after restart, or if I wait a few minutes then query it. Still get 744 followed by -6200. So am I losing bytes, does it take 2 reads for Timer1 to initialize, or...?
I don't understand what you're trying to achieve, but I very much doubt the first line of your code does what you intend:
if (-25<humidity_result<125)
I suspect you intend this to return true when humidity_result is greater than -15 and less that +125. It won't. It will be evaluated as two expressions. The first expression will be (25 < humidity_result), which will produce a boolean value. The second expression will be (boolean < 125), which will always be true since booleans are represented by int values 0 and 1 which are both less than 125.
If you want to check that the value is within a range, you need two expressions, for example:
The if will result (nearly) allways in true: humidity is something between 0 and 100% (normally, but I can't see your whole sketch from here)
-25< humidity_result will return true or false (0 or 1) which are both smaller than 125 ==> true
humidity_result<125 will return in true (1) which is bigger than -25 ==> true
You could replace the block with only the while part
while ((humidity_result < -25) || (humidity_result > 125))
{
delay(500); // assuming this is needed for the sensor?
humidity_result = humidity(temperatureC); // is temperatureC constant or changing ???
}
humidity_r = humidity_result;