Hi,
You’re right: the Adafruit code does look odd.
As you say, to initiate communication with the DHT11/DHT22, you’re supposed to pull the signal low for > 18 ms, then high, then wait for the signal to be pulled low again. Their code appears to skip the pull-high part. I can only assume that the Pi stops pulling the signal low when it switches to input mode.
The only possible problem I can see in your code is that you might not be pulling the signal low for long enough: perhaps the usleep(2000) should be usleep(20000)? Also, trying to catch that 40 microsecond signal that begins the DHT22’s response is tricky - that’s probably why the Pi’s code doesn’t pull the line high explicitly. Perhaps dropping the digitalWrite(HIGH) from your code would have the same effect?
I have my doubts about whether reading data from the DHT22 can work reliably from Linux code, given the tight timing involved. Apparently the Adafruit code is managing to do it on the Pi, but there is a warning at the beginning of their tutorial saying it may not work, and perhaps the library they are using is more optimized than what is available for the Bone.
Personally, I wimped out and use a separate processor to read the DHT22. I actually use a .Net Micro Framework processor for this (which surprisingly is able to handle the timings) and serial I/O, but something like the ATTiny2313 and I2C would be a better design.
Dan.