Hello,
I'm following a tutorial from http://howtomechatronics.com/tutorials/arduino/dht11-dht22-sensors-temperature-and-humidity-tutorial-using-arduino/
And the code he's provided has an error that I can't figure out. Here's the code I have:
#include <DHT.h>
#include <DHT_U.h>
/* 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
-
Arduino Playground - DHTLib
*/
#include <DHT.h>
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#include <LiquidCrystal.h> // includes the LiquidCrystal Library
#define dataPin 8
LiquidCrystal lcd(1, 2, 4, 5, 6, 7); // Creates an LCD object. Parameters: (rs, enable, d4, d5, d6, d7)
#define 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.read22(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);
}
and here is the error I have - the line the error is referring to is bold to stand out:
sketch_jul22a:27: error: expected primary-expression before '.' token
I'm very new to arduino so I'm still learning how the code process works, thanks for the help.