any1 can help me?? why my coding said
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.
how to solve this…
any1 can help me?? why my coding said
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.
how to solve this…
Many reasons, misplaced bracket or other character, incorrect board setting in IDE, bad library, bad code, bad dog…
/* DHT11/ DHT22 Sensor Temperature and Humidity Tutorial
* Program made by Dejan Nedelkovski,
* www.HowToMechatronics.com
*/
/*
* You can find the DHT Library from Arduino official website
* http://playground.arduino.cc/Main/DHTLib
*/
#include <LiquidCrystal.h> // includes the LiquidCrystal Library
#include <DHT.h>
#define dataPin 10
LiquidCrystal lcd(8, 9, 4, 5, 6, 7); // Creates an LCD object. Parameters: (rs, enable, d4, d5, d6, d7)
dht DHT;
void setup() {
lcd.begin(16,2); // Initializes the interface to the LCD screen, and specifies the dimensions (width and height) of the display
}
void loop() {
int readData = DHT.read11(dataPin);
float t = DHT.temperature;
float h = DHT.humidity;
lcd.setCursor(0,0); // Sets the location at which subsequent text written to the LCD will be displayed
lcd.print("Temp.: "); // Prints string "Temp." on the LCD
lcd.print(t); // Prints the temperature value from the sensor
lcd.print(" C");
lcd.setCursor(0,1);
lcd.print("Humi.: ");
lcd.print(h);
lcd.print(" %");
delay(2000);
}
Ask Google something like “set Arduino compiler verbosity”.
Once you have increased verbosity you well get more meaningful compiler errors. In this case something like:
'dht' does not name a type
Translated to “English” this means, “eh numpty you forgot to install the DHT libraries, install them and try compiling again”.
maybe should be just DHT dht;
How to install dht libraries
Just type that into Google.