what wrong help please

i run this code and get this error

humidity_sensor:28: error: ‘dht11’ does not name a type
humidity_sensor.ino: In function ‘void loop()’:
humidity_sensor:41: error: ‘DHT11’ was not declared in this scope

////////////////////////////////////////////////
// This demo code uses 4 different sensors and an LCD module
// to demonstrate reading a displaying continuous sensor data.
// Data is read from a mechanical tilt sensor to show FLAT or TILT
// An LDR is used to measure light level and is roughly converted to Lux
// A DHT11 is used to measure Humidity in %RH
// Finally an LM35 is used to measure temperature in degress C
//
// This code may be freely used and copied.
//
// Gareth Davies - June 2012
//
////////////////////////////////////////////////

#include <LiquidCrystal.h>
#include <dht11.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int Temp, Light, Humidity, hCheck;
boolean Tilt;

#define tempPin 0
#define lightPin 1
#define tiltPin 6
#define humidityPin 7

dht11 DHT11;

// initialise LCD library and pins
void setup() {
lcd.begin(16, 2);
pinMode(tiltPin, INPUT);
}

void loop()
{
Temp = (5.0 * analogRead(tempPin) * 100.0) / 1024;
delay(10);
Light = toLux(analogRead(lightPin));
hCheck = DHT11.read(humidityPin);
if(hCheck != 0)
Humidity = 255; //Must be an error
else
Humidity = DHT11.humidity;
Tilt = (digitalRead(tiltPin) == LOW);

showData(Temp, Light, Humidity, Tilt);
delay(1000);
}

// Change the ADC reading to Lux. Assumes a 10K pull up resistor to 5V
/* Vcc 5
Pullup 10000
Lux Ohms Voltage ADC Scaling
0 1023
1 200000 4.76 975 -0.020937188
10 30000 3.75 768 -0.043428309
80 5000 1.67 341 -0.1640625
120 4000 1.43 293 -0.8203125
150 3000 1.15 236 -0.533203125
250 2000 0.83 171 -1.5234375
300 1800 0.76 156 -3.45703125
800 700 0.33 67 -5.604580966
*/
int toLux(int adc)
{
// return (map(adc, 0, 1023, 900, 0)); simple linear model
if (adc > 975)
return 1;
else if (adc > 768)
return 1 + 0.04 * (adc - 768);
else if (adc > 341)
return 10 + 0.16 * (adc - 341);
else if (adc > 293)
return 80 + 0.82 * (adc - 293);
else if (adc > 236)
return 120 + 0.53 * (adc - 236);
else if (adc > 171)
return 150 + 1.52 * (adc - 171);
else if (adc > 156)
return 250 + 3.46 * (adc - 156);
else
return 300 + 5.6 * (adc - 67);
}

void showData (int temp, int light, int humidity, boolean tilt)
{
String s1, s2, s3;
String spaces = " ";
s1 = String(temp) + char(0xdf) + “C”;
s2 = String (light) + “Lux”;
s3 = s1 + spaces.substring(0, 16 - s1.length() - s2.length()) + s2;
lcd.setCursor(0,0);
lcd.print(s3);

if(humidity == 255)
s1 = “ERROR”;
else
s1 = String(humidity) + “%”;
if (tilt)
s2 = “TILT”;
else
s2 = “FLAT”;
s3 = s1 + spaces.substring(0, 16 - s1.length() - s2.length()) + s2;
lcd.setCursor(0,1);
lcd.print(s3);
}

and i get error
humidity_sensor:28: error: ‘dht11’ does not name a type
humidity_sensor.ino: In function ‘void loop()’:
humidity_sensor:41: error: ‘DHT11’ was not declared in this scope

Looks like you don’t have the DTH11 library installed properly.

Fix up your code: How to post code properly

Pete

You must have case correct. So the #include <DHT11.h> must match the
.h filename exactly (I presume its uppercase, they normally are).

Also the type is usually uppercase, the instance variable lowercase, so this looks
completely suspect:

dht11 DHT11;

would have expected

DHT11 dht11;

Follow the instructions to the letter. when it says shout down all copies of the IDE do just that!

Mark

You must have case correct. So the #include <DHT11.h> must match the
.h filename exactly (I presume its uppercase, they normally are).

Unless you are using WiNDoWs, which thinks it’s smarter than you are. Case doesn’t matter on file names. Yes, it’s stupid.