Error compiling for board Genuino/Uno

I am trying to find a code for the DHT11 (humidity sensor) and several YouTube tutorials have lead me to the same link. It has several examples of a code but every time i try to put these codes into the program, they will not verify. It says "Error compiling for board Genuino/Uno". Any reason why this might be when i found the codes on the "playground"section of this website?

You need to post the program that is causing a problem so we can see what you can see.

And please use the code button </>so your code looks like thisand is easy to copy to a text editor

…R

If you want to see how I've attached a DHT11 to an Uno then watch my YouTube video #46 Wireless 433MHz Rain Sensor which uses one. I have the library in the video comments zipped up which you can use too plus the full sketch which you can just edit down to the Temperature/Humidity part (should only be a few lines!).

Although this project is more about 433Mhz wireless communication than DHT11 temperature and humidity you will see how I get the data from it (it only has 3 wires on the breakout board, after all). Remember you can't query it more than once a second, max or you'll get errors but I guess you can't even compile just yet.

URL in the footer of this post, enjoy!

shelbykate19:
I am trying to find a code for the DHT11 (humidity sensor) and several YouTube tutorials have lead me to the same link. It has several examples of a code but every time i try to put these codes into the program, they will not verify. It says "Error compiling for board Genuino/Uno". Any reason why this might be when i found the codes on the "playground"section of this website?

I'm sure it will say a lot more; first enable verbose output (file-preferences-> show verbose output during compilation).
Compile, scroll up in the output window to the first orange line, select everything after that and post it here (again using the code tags mentioned by Robin2).

I have tried using several examples posted by similar projects and they all give me the same error code. This is the example i am currently working with.

#include <dht.h>

dht DHT;

#define DHT11_PIN 4

void setup()

{
  Serial.begin(115200);
  Serial.println("DHT TEST PROGRAM ");
  Serial.print("LIBRARY VERSION: ");
  Serial.println(DHT_LIB_VERSION);
  Serial.println();
  Serial.println("Type,\tstatus,\tHumidity (%),\tTemperature (C)");
}

void loop()

{
  Serial.print("DHT11, \t");
  chk = DHT.read11(DHT11_PIN);
  switch (chk)
  {
    case DHTLIB_OK:  
    Serial.print("OK,\t"); 
    break;
    case DHTLIB_ERROR_CHECKSUM: 
    Serial.print("Checksum error,\t"); 
    break;
    case DHTLIB_ERROR_TIMEOUT: 
    Serial.print("Time out error,\t"); 
    break;
    default: 
    Serial.print("Unknown error,\t"); 
    break;
  }
 
  Serial.print(DHT.humidity,1);
  Serial.print(",\t");
  Serial.println(DHT.temperature,1);

  delay(1000);
}

shelbykate19:
all give me the same error code.

Gee, I don't suppose you could post that error?

That way all the people who are answering forum posts on their phone or while on the road (without access to a system to try compiling on) can help you too!

The error is the title of the post. "Error compiling for board Genuino/Uno"

shelbykate19:
The error is the title of the post. "Error compiling for board Genuino/Uno"

There's a lot more above that line (you may have to scroll up - the default size can make the window so small that you only see the last line). That's where the information on what's causing the error is.

It may help to enable verbose compiling output, particularly if you're not seeing any error (at least then we can see what step it fails on).

Copy/paste it all here.

Ahh that makes sense, here we go

Arduino: 1.6.10 (Windows 10), Board: “Arduino/Genuino Uno”

C:\Users\user\Downloads\arduino-1.6.10-windows\arduino-1.6.10\arduino-builder -dump-prefs -logger=machine -hardware “C:\Users\user\Downloads\arduino-1.6.10-windows\arduino-1.6.10\hardware” -tools “C:\Users\user\Downloads\arduino-1.6.10-windows\arduino-1.6.10\tools-builder” -tools “C:\Users\user\Downloads\arduino-1.6.10-windows\arduino-1.6.10\hardware\tools\avr” -built-in-libraries “C:\Users\user\Downloads\arduino-1.6.10-windows\arduino-1.6.10\libraries” -libraries “C:\Users\user\Documents\Arduino\libraries” -fqbn=arduino:avr:uno -ide-version=10610 -build-path “C:\Users\user\AppData\Local\Temp\builda65c9e73b494994642304e7156a05b64.tmp” -warnings=none -prefs=build.warn_data_percentage=75 -verbose “C:\Users\user\Documents\Arduino\humidity_sensor\sketch_aug07d\sketch_aug07d.ino”
C:\Users\user\Downloads\arduino-1.6.10-windows\arduino-1.6.10\arduino-builder -compile -logger=machine -hardware “C:\Users\user\Downloads\arduino-1.6.10-windows\arduino-1.6.10\hardware” -tools “C:\Users\user\Downloads\arduino-1.6.10-windows\arduino-1.6.10\tools-builder” -tools “C:\Users\user\Downloads\arduino-1.6.10-windows\arduino-1.6.10\hardware\tools\avr” -built-in-libraries “C:\Users\user\Downloads\arduino-1.6.10-windows\arduino-1.6.10\libraries” -libraries “C:\Users\user\Documents\Arduino\libraries” -fqbn=arduino:avr:uno -ide-version=10610 -build-path “C:\Users\user\AppData\Local\Temp\builda65c9e73b494994642304e7156a05b64.tmp” -warnings=none -prefs=build.warn_data_percentage=75 -verbose “C:\Users\user\Documents\Arduino\humidity_sensor\sketch_aug07d\sketch_aug07d.ino”
Using board ‘uno’ from platform in folder: C:\Users\user\Downloads\arduino-1.6.10-windows\arduino-1.6.10\hardware\arduino\avr
Using core ‘arduino’ from platform in folder: C:\Users\user\Downloads\arduino-1.6.10-windows\arduino-1.6.10\hardware\arduino\avr
Detecting libraries used…
“C:\Users\user\Downloads\arduino-1.6.10-windows\arduino-1.6.10\hardware\tools\avr/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10610 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR “-IC:\Users\user\Downloads\arduino-1.6.10-windows\arduino-1.6.10\hardware\arduino\avr\cores\arduino” “-IC:\Users\user\Downloads\arduino-1.6.10-windows\arduino-1.6.10\hardware\arduino\avr\variants\standard” “C:\Users\user\AppData\Local\Temp\builda65c9e73b494994642304e7156a05b64.tmp\sketch\sketch_aug07d.ino.cpp” -o “nul”
“C:\Users\user\Downloads\arduino-1.6.10-windows\arduino-1.6.10\hardware\tools\avr/bin/avr-g++” -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10610 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR “-IC:\Users\user\Downloads\arduino-1.6.10-windows\arduino-1.6.10\hardware\arduino\avr\cores\arduino” “-IC:\Users\user\Downloads\arduino-1.6.10-windows\arduino-1.6.10\hardware\arduino\avr\variants\standard” “C:\Users\user\AppData\Local\Temp\builda65c9e73b494994642304e7156a05b64.tmp\sketch\sketch_aug07d.ino.cpp” -o “C:\Users\user\AppData\Local\Temp\builda65c9e73b494994642304e7156a05b64.tmp\preproc\ctags_target_for_gcc_minus_e.cpp”
C:\Users\user\Documents\Arduino\humidity_sensor\sketch_aug07d\sketch_aug07d.ino:1:17: fatal error: dht.h: No such file or directory

#include <dht.h>

^

compilation terminated.

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

Oh, that's an easy one to fix - you need to find and install the dht library.

It is installed.. is it possible that arduino cant find the file?

No, if it were installed, Arduino would use it - you've installed the library incorrectly, and as a result the Arduino IDE can't see it.

Libraries should go in (sketchbook folder - normally Arduino in your documents folder)/libraries. Be sure that there isn't an extra layer of folders. Folder name must match the library name - be sure to remove the -master from the end if it was a github download).

I think you need to restart the IDE after adding libraries - not sure.

DrAzzy:
I think you need to restart the IDE after adding libraries - not sure.

With Arduino IDE 1.6.5-r5 and earlier if you manually upload then you either need to restart the IDE or open, then close Sketch > Include Library > Manage Libraries. With Arduino 1.6.6 or higher that's not necessary. If you do a Sketch > Include Library > Add .ZIP Library or Library Manager installation then you don't need to restart.