Problem Using DHT Sensor Library

Hello,

I’m obviously quite new to this and I’m getting this error code when I try using the DHT Sensor Library that I downloaded. When I searched I got the library from GitHub. Is that not a compatible library source?

C:\Users\XXXXXXX\Documents\Arduino\libraries\DHT-sensor-library-master/DHT_U.h:25:29: fatal error: Adafruit_Sensor.h: No such file or directory

#include <Adafruit_Sensor.h>

When I check it appears to be in the correct folder on my computer

C:\Users\XXXXXXX\Documents\Arduino\libraries

When I check it appears to be in the correct folder on my computer

What does?

Show us a list of files in that folder.

When I look in the folder C:\Users\XXXXXXX\Documents\Arduino\libraries it shows the DTH Sensor library there but it is the only library listed. It must be in the wrong folder. Where should it be saved?

it shows the DTH Sensor library there but it is the only library listed.

Is that anything like the DHT library?

That is not the library that the compiler is saying is missing.

Attached is a screenshot of the folder and its contents

From the Adafruit DHT Sensor library page:

You must have the following Arduino libraries installed to use this class: Adafruit Unified Sensor Library

You REALLY should use Tools + Folder Options, select the View tab, uncheck the “Hide extensions for know file types”, and flip Microslop the bird for ever having considered implementing the *^+^&% stupid idea.

You need to also download and install the Adafruit_Sensor library. Why the site that you got the DHT library from didn’t tell you that, and provide links, is a mystery.

Why the site that you got the DHT library from didn't tell you that, and provide links, is a mystery.

No mystery. They did, but one must scroll down to see it.

groundFungus: No mystery. They did, but one must scroll down to see it.

I kind of figured that that would prove to be the case. I wanted OP to tell us where he/she got the UHT library from, next, to check that.

Not sure exactly what you mean but I did download the other file. I attached an image of the folder again but it still doesn’t work.

but it still doesn't work.

Did you restart the IDE?

you have to install the downloaded library. The file in the directory is still zipped. Zipped files do not belong in the library folder. Here is how to install libraries.. You will need to scroll down to "Importing a .zip Library".

Zipped files do not belong in the library folder.

There's no real harm having them there. They don't need to be there, and probably shouldn't be there, but they won't cause problems being there.

The file was unzipped, as evidenced by the folder with the same name. Stupid idiots at Microsoft.

Yes files are unzipped and when I look in Library manager it shows it installed. I attached an image again :slight_smile:

This is the exact error code I get
In file included from C:\Users\XXXXXXX\Documents\Arduino\sketch_may09b\sketch_may09b.ino:2:0:

C:\Users\XXXXXXX\Documents\Arduino\libraries\DHT-sensor-library-master/DHT_U.h:25:29: fatal error: Adafruit_Sensor.h: No such file or directory

#include <Adafruit_Sensor.h>

^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

Invalid library found in C:\Users\XXXXXXX\Documents\Arduino\libraries\Adafruit_Sensor-master: C:\Users\Peter.SaXXXXXXX\Documents\Arduino\libraries\Adafruit_Sensor-master

Try renaming the folder to get rid of the -master crap.

Didn't work either. It needs the full name or I get a different error. I'll wait till my son is home he is younger and smarter than me so he can likely figure it out. Thanks for your help though :)

It needs the full name or I get a different error.

What error did you get, then?

See attached

psam:
See attached

02d87f507879af5c7ba9888eced39fb11e3c5340.png
That is a strange error.

The -master on the folder name will not cause the “No such file or directory” error or the “Invalid library found” warning on any IDE version that has Library Manager (which your screen shot shows you’re using).

psam:
Invalid library found in C:\Users\XXXXXXX\Documents\Arduino\libraries\Adafruit_Sensor-master: C:\Users\Peter.SaXXXXXXX\Documents\Arduino\libraries\Adafruit_Sensor-master

This warning makes me suspect you have something like this:

C:\Users\XXXXXXX\Documents\Arduino
|_libraries
|_Adafruit_Sensor-master
|_Adafruit_Sensor-master
|_Adafruit_Sensor.h

The correct folder structure is:

C:\Users\XXXXXXX\Documents\Arduino
|_libraries
|_Adafruit_Sensor-master
|_Adafruit_Sensor.h

If you already have the latter folder structure then I recommend you to delete the C:\Users\XXXXXXX\Documents\Arduino\libraries\Adafruit_Sensor-master folder and then unzip C:\Users\XXXXXXX\Documents\Arduino\libraries\Adafruit_Sensor-master.zip again so see if maybe C:\Users\XXXXXXX\Documents\Arduino\libraries\Adafruit_Sensor-master was corrupted the first time (which might have caused the strange error in your last reply).