DHT22 & RTC conflict ?

Hi Guys,

I face an issue with my dht22 and rtc program.
I would like to create a program which would display on SerialMonitor the temperature and humidity with the time pulled from rtc.

Separate programs for DHT and RTC works perfectly, however when I combine them, the DHT value for temp and humidity is nan. Of course time is displaying fine.

When I remove the part of the code responsible for RTC from the void setup, the DHT is working fine.

If you ever faced similar issue, or if you have any idea how to fix it, please let me know.

I am attaching the two version of the program and libraries I use.

Thank you in advance for your help!

Macu

DHT-sensor-library-master.zip (18.6 KB)

RTClib-master.zip (28.2 KB)

DHT_RTC_1.ino (1.12 KB)

DHT_RTC_2.ino (1.2 KB)

It appears you are using the same pin for both items.
Good Luck & Have Fun!
Gil

gilshultz:
It appears you are using the same pin for both items.

I can't be bothered to download those sketches to check, but you would think the OP would have noticed one pin was already occupied when s/he tried to jam another wire in :wink:

LOL guys! I suppose you both know what is happening. Thanks for wishing me fun. It is a lot of fun.:slight_smile:
Leonardo and doubled SCL and SDA pins. Sooo simple.

#define DHTPIN 4 - solved an issue. And wire putted in to the right "hole" :wink:

Thanks!