Hello,
I am repeating somebody's project. It uses dht11 temp/humidity sensor.
Sketch for that project uses dht11.h library. The problem is that it is custom written library.
I have code for this library (for .h and .CPP files), but don't know how to ulpoad it into the arduino library. I tried to save those codes with extensions dht.h and dht.CPP and put it into /library/dht/.
It did not work,during the compilation of the project code I am getting error massage about dht library. How???
Basil1:
I have code for this library (for .h and .CPP files)
Where did you get this mysterious code? Post a link to where it is located online. Use the chain links icon on the toolbar to make the link clickable.
Basil1:
but don't know how to ulpoad it into the arduino library.
I do, but I can't give you instructions because you're being so vague.
Basil1:
and put it into /library/dht/
Where are those folders?
Basil1:
I am getting error massage about dht library.
Oh goody, a mysterious error message too! Well if you actually want help from us don't you think it might be a good idea to actually post the full contents of the error message? If you ever decide to do that then be sure to use code tags (</> button on the toolbar).
Thank you for pointing that out.
Project code that I'm trying to run has the line in the begining to include dht library
#include<dht.h>
When I tried to compile that code it gave me following error
error: 'dht' does not name a type
dht DHT;
The project code owner reply was "Download DHT library from Arduino Playground - DHTLib and install it"
When I open this page I found the code for dht.h and dht.cpp at the end of the page.
How can I install it into my arduino library without having packed .zip file?
Hope this time my explanation was better, I am an beginner, please bare with me
You forgot to use code tags for the error message as I requested.
You forgot to make the link clickable as I requested.
Using code tags and other important information is explained in the How to use this forum post. Please read it.
If you look at that Playground page, you'll see this at the top:
So unless you have a good reason for using the version of the library on the Playground page I recommend you to use the version on GitHub since the Playground one is likely to be outdated.
Unfortunately the GitHub repository is a bit of a mess because it has about 50 different libraries mashed into a single repository, which makes installation a bit more complicated. Here's instructions for installing the library from GitHub:
- Download https://github.com/RobTillaart/Arduino/archive/master.zip
- Copy the folder libraries/DHTlib from the downloaded file to the libraries subfolder of your sketchbook folder. If you don't know the location of your sketchbook folder you can find it at File > Preferences > Sketchbook location
- Restart the Arduino IDE if it's running.
- You will now find the examples that are included with the library at File > Examples > INCOMPATIBLE > DHTlib. Don't worry about the INCOMPATIBLE thing or the "WARNING: library DHTlib claims to run on (atmelavr) architecture(s) and may be incompatible with your current board which runs on (avr) architecture(s)." warning you'll get during compilation. That's just caused by an incorrect architectures value in the library metadata. I have submitted a pull request to fix this (again): [DHTlib] Use correct architectures value in library.properties by per1234 · Pull Request #82 · RobTillaart/Arduino · GitHub.
Correct folder structure after you've installed the library:
{sketchbook folder}
|_libraries
|_DHTlib
Refer to this:
Thank you very much.
It is all clear now. I'll try it tonight.
PS. I corrected my previous post according to the requirements