dht error

hello every one,
when I am compiling this code, i got the error "dht does not name a type"

#include <DHT.h>

#include <DHT22.h>

dht DHT;

#define DHT22_PIN 5

void setup()
{
Serial.begin(9600);
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()
{
// READ DATA
Serial.print("DHT22, \t");
int chk = DHT.read22(DHT22_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;
}
// DISPLAY DATA
Serial.print(DHT.humidity, 1);
Serial.print(",\t");
Serial.println(DHT.temperature, 1);

delay(1000);

}

i am using dht22 temp and humidity sensor, my libraries are in correct folder.

can any one help me removing this type of error..??

thanks in advance

There is a convention that the file name match the class name. Since the file name is DHT.h, this implies that the class name is DHT, not dht.

Of course, without seeing a link to the library, we can only guess.

when I change the class name to DHT still showing the error. Since I am a new bee to this arduino please can you be more specific and explain to me...... :blush:

Since I am a new bee to this arduino please can you be more specific and explain to me.

Sure. You need to post a link to the library. That way, we don't have to guess.

If neither DHT or dht is recognized as a valid type name, then chances are that you didn't download and install the library correctly.

this is for dht22.h

and this is for dht.h library

I recognize the application code from yet another source - Arduino Playground - DHTLib -

Think you also have a problem mixing different libs in one sketch....(the interfaces are different)

You don't need both of those includes.

And the name of the class seems to be neither dht nor DHT, in the one I am looking at, it is DHT22..

Look inside the .h file that you actually use, the class name is in there, that is the class name you actually have to use to create an object of that class type.

i don't know whats the problem is......I looked in .h file also but there also dht22.h or dht.h is written
the problem is still there.........
any more suggestions...

Go have a look at the link Rob gave you. Download and install his library (remove the others first). There is an example there for you to get an understanding of the syntax.

It works. I've been using it for some time now.

hey guys....i downloaded the dht libraries from the Rob's link. Now my program is working well without any error....
thanks rob and thanks other guys for your time. :wink:

hey guyz......i have one more question......
I am using LDR and redbear BLEShield.........can I send LDR data to my iphone via bluetooth..??
the data which shows in the serial monitor when we connect LDR to arduino that approx value of light surrounding LDR....
any suggestion regarding this...??