adafruit/DHT-sensor-library

Change [#include "DHT.h"] to [#include <DHT.h>], my thought

jkadofo opened this issue · 2 comments

Hello friends,

I am trying out this "DHT Sensor Library", and started off by using the "DHTtester" example.

The issue is related to this line of code:

TL;DR:
I think the #include directive here must be used with angle brackets (<>) rather than double quotes ("") to reduce the chance of surprises. If this is deemed unnecessary, kindly explain to me. Thanks.

Details:
Upon a quick inspection of the "DHTtester" example code, I noticed the library was included as:
#include "DHT.h"

That is, the DHT.h was included as a source file from current sketch directory rather than using angle brackets (<>) to include it as a standard header file as in:
#include <DHT.h>

Both versions compile fine for me (even when I have my sketch folder in another location). However I think the angle bracket version would be a better option as that would prevent any surprises, for example if the user somehow had another "DHT.h" file in their working sketch folder.

Furthermore, the other example which is "DHT_Unified_Sensor" uses angle brackets to include the DHT.h and other dependencies, as shown below:

In conclusion, I think we should use angle brackets for "DHTtester" example. If this is however deemed unnecessary, I would be glad to get an explanation for that so I can learn from it.

Thanks for your hardwork and efforts to put together this library and many others.
Cheers.

If you submit a PR I'll be happy to review it

Closing for now. Can reopen if can be demonstrated as actual issue.