Dht 11 library problem

I am facing this kind of error .How can I solve it?

Code:
#include "dht.h"
#define dht1_pin 46// Analog Pin sensor is connected to

#define Relay1 22
#define Relay2 24
#define Relay3 26
#define Relay3 28

dht DHT1;

Error: dht.h: No such file or directory

You need to install a dht library.
Go to the library manager in the IDE.

1 Like

I installed a dht library but same problem occur.

Look at the examples from that library to see how the include statements are formed.

1 Like

I am very new....I can not understand, how can i solve this issue.

Post your code, and post your error messages.
Use code tags.

1 Like

I am facing problem with that

#include "dht.h"

for this....this error shows..............

fatal error: dht.h: No such file or directory
#include "dht.h"
^~~~~~~
compilation terminated.
exit status 1
dht.h: No such file or directory

We already saw that in the first post. Please follow instructions. Post the entire sketch (in code tags) and the entire error listing.

Also, what is the source of the sketch? Did you create it from scratch? If not, where did you get it?

#define DHTTYPE DHT11 // DHT 11
DHT dht(DHTPIN, DHTTYPE); // Create Object

1 Like
#include <dht.h>

Which you would see if you looked at the library examples as I suggested...

Thankyou Everyone. I have solved the problem.

What was it?

Make sure that the library is inside of its own folder in the "libraries" folder in the arduino folder on your computer. restart the ide and it should work.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.