There is a lot going on with this pin in this library… I wonder if there is a subtle difference that’s preventing interrupts from working the same way on D6 as it does on the rest of the pins:
* Toggle the digital output to trigger the DHT device
* to send us temperature and humidity data
if (_type == DHT11)
delay(18); // DHT11 Spec: 18ms min
delayMicroseconds(1500); // DHT22 Spec: 0.8-20ms, 1ms typ
pinMode(_sigPin, INPUT); // Note Hi-Z mode with pullup resistor
// will keep this high until the DHT responds.
* Attach the interrupt handler to receive the data once the DHT
* starts to send us data
_us = micros();
attachInterrupt(_sigPin, isrCallback_wrapper, FALLING);
AHA… attachInterrupt() is not supported on the Core for pins D5~D7 or A2
I would say the library needs protection against those pins being used
This library does say this as well:
- This library supports the DHT sensor on the following pins
- D0, D1, D2, D3, D4, A0, A1, A3, A5, A6, A7
I’m not sure why A4 is not included.
Should work with a Photon as all pins are supported.
I’m going to make this as solved.