Does DHT11 need to use analog pin?

Hi,

I'm tinkering with the DHT11 humidity/temperature sensor and trying to figure out why it sometimes works, and other times doesn't.
Anyhow, in my musings, I suddenly asked myself "Why do all of the example sketches for DHT11 seem to use an analog pin for comms?" I tried using a digital pin, and it didn't seem to work, even though the only values being read were 'pin high' and 'pin low'. I've just checked in the DHT11 library Arduino Playground - DHT11Lib and noticed that it uses a digital pin for its I/O ...so it looks like both analog and digital pins should work ok.

So my question to the forum is this. Is there any difference between using an analog pin or a digital pin when measuring digital values (on, off)? I was wondering if there might be a difference in the time it takes the pins to transition from 0 to 1 or vice versa. Also, are there fundamental timing differences between a digitalRead() and an analogRead()? I guess the latter doesn't matter if you are reading them using low level code e.g. PINC & _BV(0) for analog pin 0 and PIND & _BV(7) for digital pin 7.

Does anyone have some thoughts on this?

It takes way longer to do an analogue read than it takes for a digital read. The analogue read has the advantage that you can set your high / low threshold at whatever level you want and you can even program in hysteresis if required.

if you are reading them using low level code e.g. PINC & _BV(0) for analog pin 0 and PIND & _BV(7) for digital pin 7.

PINC & _BV(0) does not read analog input 0 but digital input 14, both are on pin A0. On an UNO all analog inputs (A0-A5) are multiplexed with digital IOs 14-19, so you can use them both ways. If you have a clone that uses an SMD version of the ATmega328, it may have the A6 and A7, analog input pins that are not multiplexed with GPIOs (digital IOs).