problem with DHT11 returning 21 bits instead of 41 ...

Hi,

Something strange happened when i used your code for replacing the PulseIn() command ...
I got these results :

112,116,112,120,112,120,112,120,112,120,112,120,112,120,116,112,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,120,516
112,112,120,112,120,112,120,112,120,112,120,112,120,112,120,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,516
120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,516
120,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,516
120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,116,120,112,120,112,120,112,120,112,120,112,120,112,124,112,120,112,120,516
112,120,116,112,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,120,112,112,120,112,120,112,120,112,120,112,120,112,516
112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,116,120,112,120,516
112,112,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,516
120,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,516
120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,516
112,112,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,516
120,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,516
112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,516
112,112,120,112,120,112,120,112,120,112,120,112,124,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,516
112,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,112,120,120,112,516

Surely, i couldn't use them because they was very inacurate (max value : 124 ; min value : 112) ...
I then realised that in your code the command "analogRead" was used, and i changed it to "digitalRead" which was more appropriate, and then TAAADAAA !!!! miracle !!!!

I could then obtain the total message of 41 bits which looked like this :

88,24,28,72,20,20,68,24,28,24,28,28,24,28,24,24,28,24,20,20,72,28,72,72,72,28,20,24,20,24,24,24,24,28,28,72,72,72,24,76,72
92,24,20,72,28,28,72,20,28,24,24,28,24,20,24,28,24,28,24,20,72,28,72,72,72,24,28,24,24,28,24,28,28,20,28,72,72,68,20,72,72
92,24,24,72,24,24,68,24,24,28,24,24,28,24,20,20,24,28,24,24,76,24,72,72,72,20,24,24,28,28,24,28,28,24,24,72,72,72,20,72,72
92,24,24,76,24,28,72,28,24,28,24,24,28,24,28,24,28,20,20,20,72,24,72,68,68,24,24,28,24,24,28,24,24,28,24,72,72,68,28,72,72
92,28,24,72,24,28,72,24,28,28,24,24,28,24,24,24,24,28,28,24,72,24,72,68,68,20,24,20,24,28,24,28,24,28,24,72,72,68,20,72,68
92,24,24,72,24,16,72,28,24,28,24,24,28,24,28,20,24,32,24,20,72,24,72,72,72,20,24,20,20,24,20,20,28,24,28,72,72,72,24,68,68
88,24,24,68,24,28,72,24,24,28,24,28,24,28,24,28,28,20,24,20,68,24,72,72,72,24,28,28,20,24,20,24,28,24,28,68,68,72,24,72,68
92,24,28,72,24,20,72,24,28,28,24,28,24,24,28,24,24,28,24,24,72,28,72,72,72,24,20,20,24,24,20,24,28,24,28,72,72,72,24,72,68
88,28,28,72,28,24,68,24,28,24,28,28,24,28,20,28,24,24,20,24,72,28,72,72,72,20,28,24,24,20,20,24,24,28,28,72,72,72,28,72,68
92,24,28,72,20,20,72,28,24,24,24,28,24,28,28,24,24,28,24,28,72,24,72,72,72,28,20,20,20,20,28,24,32,24,28,72,72,72,28,72,68
92,24,24,72,24,28,68,28,24,28,24,24,28,24,28,20,16,20,24,24,68,24,72,72,72,20,20,28,20,24,20,20,28,24,28,72,72,72,24,72,68
88,28,24,72,24,24,72,24,24,28,24,24,24,28,24,28,28,20,24,24,68,24,72,64,72,24,28,24,20,24,20,24,28,24,28,68,72,72,24,72,64
88,24,28,72,20,24,76,24,28,24,24,28,24,28,28,20,28,24,24,20,72,28,72,72,72,24,20,24,28,20,20,24,24,28,28,72,72,72,20,72,68
92,24,20,68,24,28,72,20,24,28,24,28,28,24,24,28,28,24,24,20,68,24,72,72,72,24,24,28,24,28,28,24,28,28,24,72,72,72,24,68,68
88,28,28,72,20,28,72,28,28,24,28,24,24,28,24,20,28,24,28,28,72,28,72,72,72,20,20,24,24,24,28,24,24,24,28,72,72,72,20,72,72
92,24,24,72,24,28,68,24,24,28,24,28,28,24,28,20,28,20,24,20,68,24,72,72,72,20,16,24,24,28,20,20,28,24,28,72,72,76,24,72,68
84,24,28,72,24,28,72,28,24,28,24,20,24,28,24,24,28,20,24,20,72,24,72,72,72,24,24,28,24,20,24,20,28,24,28,72,72,72,24,72,64

I modded the DHT11 library v0.4 of George Hadjikyriacou to reflect the changes.

Thank you for your help, now the lib is working greatly =]

PS : When the lib will be finalised, i'll post it right here on this post.

By the way, as it seems thath the "PulseIn()" command has a bug, is there a way to report the bug to the DEV TEAM of the arduino ?