I am using a arduino and dht22 sensor for my project purpose annd gettting error as expecte before unqualified '.' token
MY CODE IS :
#include <DHT.h>
#include <LiquidCrystal.h>
#include <SoftwareSerial.h>
#include <Wire.h>
#define DHTPIN 8
#define DHTTYPE DHT22
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
int ldrpin=A0;
int ldr=0;
DHT dht(DHTPIN, DHTTYPE);
//
//
//
//
//
//
//
//
void setup()
{
lcd.begin(16, 2);
Serial.begin (9600);
DHT .begin();
pinMode(ldrpin,INPUT);
}
//
//
//
//
//
//
//
void loop()
{
lcd.setCursor(0,0);
//ldr
ldr=analogRead(ldrpin);
//LDR DISPLAY
Serial.println("LIGHT INTENSITY");
Serial.println(ldr);
Serial.print(" lx\t");
delay(2000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("LIGHT INTENSITY");
delay(200);
lcd.print(ldr);
delay(2000);
//dht22
delay(2000);
int chk = DHT.read(DHTPIN);
float humidity = DHT.humidity;
float temperature = DHT.temperature;
//dht22 display
1. Serial.println("Humidity: ");
2. Serial.print(h);
3. Serial.print(" %\t");
4. Serial.println("Temperature: ");
5. Serial.print(t);
Serial.println(" *C ");
my error message is
Arduino: 1.6.4 (Windows 8.1), Board: "Arduino Uno"
LCD.ino: In function 'void setup()':
LCD:38: error: expected unqualified-id before '.' token
LCD.ino: In function 'void loop()':
LCD:80: error: expected primary-expression before '.' token
LCD:81: error: expected primary-expression before '.' token
LCD:82: error: expected primary-expression before '.' token
LCD:87: error: expected ';' before 'Serial'
LCD:88: error: expected ';' before 'Serial'
LCD:89: error: expected ';' before 'Serial'
LCD:90: error: expected ';' before 'Serial'
LCD:91: error: expected ';' before 'Serial'
expected unqualified-id before '.' token
This report would have more information with "Show verbose output during compilation" enabled in File > Preferences.
some one help me please!!