I've tried the DHT11 using the DHT22 and it runs but the numbers seems off or my setup is just giving checksum errors shown below:
Temperature: 0.207
Humidity: 2.69
ChecksumReceived: 22
ChecksumTest: 23
> dofile('DHT11.lua')
Temperature: 128.103
Humidity: 1.34
ChecksumReceived: 139
ChecksumTest: 11
> dofile('DHT11.lua')
Temperature: 0.103
Humidity: 1.34
ChecksumReceived: 138
ChecksumTest: 138
> dofile('DHT11.lua')
Temperature: 128.103
Humidity: 1.33
ChecksumReceived: 9
ChecksumTest: 10
> dofile('DHT11.lua')
Temperature: 0.206
Humidity: 2.68
ChecksumReceived: 20
ChecksumTest: 21
> dofile('DHT11.lua')
Temperature: 128.103
Humidity: 1.34
ChecksumReceived: 139
ChecksumTest: 11
> dofile('DHT11.lua')
Temperature: 0.207
Humidity: 2.69
ChecksumReceived: 22
ChecksumTest: 23
If you don't mind I will have a look through your code and try and see if I can replicate it in mine.
According to the Mbed C code example the author states that the DHT22 is shifting the bits 1 to the left which is not in the data sheet. I can't tell because all I get in terms of bits is generally '010111111111111111' so basically after a while it reads only high. I think this may be die to the tight timing but more investigation is required.
Edit* Ahh now I see what you did with the acquisition of data, rather then relying on length of delay you simply take any bit length longer then 2 to be high etc.
Kind Regards
Cdr