# Error Message

**URL:** <https://forum.arduino.cc/t/error-message/703247>\
**Category:** Programming\
**Created:** [April 3, 2021, 6:44pm UTC](https://forum.arduino.cc/t/error-message/703247 "2021-04-03T18:44:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sweninger](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@sweninger](https://forum.arduino.cc/u/sweninger)\
**Post date:** [April 3, 2021, 6:44pm UTC](https://forum.arduino.cc/t/error-message/703247/1 "2021-04-03T18:44:03Z")

</div>

I copied this code from the Arduino Project Hub and I get the following error message when I check the code before I try to download. How do I correct this issue as I get this issue when ever I copy or download code that has been written from sources such a Githup. I will post the error message and the cod will follow.

Error message:

Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: "Arduino Uno"

In file included from C:\Users\leave\OneDrive\Documents\Arduino\libraries\DHT\_sensor\_library\DHT\_U.cpp:15:0:

C:\Users\leave\OneDrive\Documents\Arduino\libraries\DHT\_sensor\_library\DHT\_U.h:36:10: fatal error: Adafruit\_Sensor.h: No such file or directory

#include \<Adafruit\_Sensor.h\>

^ ~~~~~~~~~~~~~~~~~~

compilation terminated.

exit status 1

Error compiling for board Arduino Uno.

This report would have more information with  
"Show verbose output during compilation"  
option enabled in File -\> Preferences.

## Code: /\*

- Library required: -
- "LiquidCrystal", "DHT\_sensor\_library" and "Adafruit\_Sensor-master" -
- Download: Adafruit\_Sensor-master on Github: [https://github.com/adafruit/Adafruit\_Sensor](https://github.com/adafruit/Adafruit_Sensor) -
- Put it in your Arduiono dictory "libraries" -
- License: GNU General Public License version 3 or later (GPL3+) -
- By HilfePlus -

* * *

\*/

// --Library-- / Bibliotheken  
#include \<LiquidCrystal.h\>  
#include \<DHT.h\>

// Sensor DHT-11 (DHT-11 Temperature and Humidity Sensor)  
#define DHTPIN 8  
#define DHTTYPE DHT11

// LCD Display (PIN)(LCD1602 Module)  
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);  
DHT dht(DHTPIN, DHTTYPE);

void setup() {  
// Serial Monitor  
Serial.begin(9600);

// LCD Display  
lcd.begin(16, 2);  
lcd.setCursor(7,1);  
lcd.print("By Hilfe+");  
dht.begin();

// LCD Display (Temp and Humidity)  
lcd.setCursor(0,0);  
lcd.print("Temp:");  
lcd.setCursor(0,1);  
lcd.print("Humid:");  
delay(1500);  
}

void loop() {  
lcd.setCursor(12,1);  
lcd.print("%");  
// Load (Arrow)  
delay(550);  
lcd.setCursor(13,0);  
lcd.print("\<");  
delay(50);  
lcd.setCursor(14,0);  
lcd.print("-");  
delay(50);  
lcd.setCursor(15,0);  
lcd.print("-");  
delay(50);  
lcd.setCursor(15,1);  
lcd.print("-");  
delay(50);  
lcd.setCursor(14,1);  
lcd.print("-");  
delay(50);  
lcd.setCursor(13,1);  
lcd.print("\<");

// ...  
lcd.setCursor(12,0);  
lcd.print(" ");

// -- Temp and Humidity --  
// Temp = Temperature in Fahrenheit and Humid = Humidity  
float f = dht.readHumidity();  
float c = dht.readTemperature(true);

// Sensor Error (For Example No Sensor)  
if (isnan(f) && (c)) {  
lcd.clear();  
lcd.setCursor(4,1);  
lcd.print("|SENSOR|");  
lcd.setCursor(4,0);  
lcd.print("|ERROR |");  
delay(1000);  
return;  
}

// LCD Display (values)  
lcd.setCursor(7,0);  
lcd.print(c);  
lcd.setCursor(7,1);  
lcd.print(f);

// Serial Monitor  
Serial.println("- Result -");  
Serial.print("Temp: ");  
Serial.println(c);  
Serial.print("Humid: ");  
Serial.println(f);  
Serial.println("- - - - - -");  
Serial.println(" ");  
Serial.println(" ");

// Ende (Arrow)  
delay(400);  
lcd.setCursor(15,1);  
lcd.print(" ");  
delay(50);  
lcd.setCursor(14,1);  
lcd.print(" ");  
delay(50);  
lcd.setCursor(13,1);  
lcd.print(" ");  
delay(50);  
lcd.setCursor(13,0);  
lcd.print(" ");  
delay(50);  
lcd.setCursor(14,0);  
lcd.print(" ");  
delay(50);  
lcd.setCursor(15,0);  
lcd.print(" ");  
delay(50);  
}

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [April 3, 2021, 6:47pm UTC](https://forum.arduino.cc/t/error-message/703247/2 "2021-04-03T18:47:04Z")

</div>

Install the Adafruit\_Sensor library

And please edit your post and put  
**`** **[code]**  **`**  
before your code and  
**`** **[/code]**  **`**  
after your code so it looks like

```cpp
your code here

```

---

<div class="post-metadata">

**Author:** ![sweninger](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@sweninger](https://forum.arduino.cc/u/sweninger)\
**Post date:** [April 3, 2021, 11:42pm UTC](https://forum.arduino.cc/t/error-message/703247/3 "2021-04-03T23:42:23Z")

</div>

What I don't understand is why I get the error message. I've copied or downloaded code from the Arduino site or other sites like Github before and very rarely have issues. Lately, I am getting the error message more often than not.

---

<div class="post-metadata">

**Author:** ![pert](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/pert/32/217111_2.png) [@pert](https://forum.arduino.cc/u/pert)\
**Post date:** [April 4, 2021, 12:04am UTC](https://forum.arduino.cc/t/error-message/703247/4 "2021-04-04T00:04:26Z")

</div>

You're going to get this error message any time you have not installed a library dependency of the sketch you're attempting to compile. That's just how it works. Some sketches don't require any additional libraries to be installed, so you'll find you can compile those without installing libraries. The Adafruit\_Sensor library is a dependency of the DHT\_sensor\_library your sketch uses, so it will never compile if you don't have that library installed.

If you are getting some unexpected results, you are welcome to provide details and we'll check it out, but what you've shared so far only indicates that you were trying to compile a sketch that had a dependency on the Adafruit\_Sensor library when you hadn't installed that library.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [August 2, 2021, 12:04am UTC](https://forum.arduino.cc/t/error-message/703247/5 "2021-08-02T00:04:45Z")

</div>

Closed on August 2, 2021, 12:04am UTC

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