I need help about my arduino project.

Hello!
I'm new in arduino world and after some simple projects I decided to make a little bit harder project (for me). So I opted for a project with the little computer fan and a DHT11 sensor. I started writing the code for the project an when i finshed i saw that software shows me a lot of errors. The idea of the project is that when temperature rises above 20 Celsius degrees fan starts to work. So if anybody know how to write code in right way please help. And I'm not from UK or USA so please dont mind on my English.

Here is my code:

int VENT = 11;

#define dht_dpin A0
 

void setup() {
 
 
  Serial.begin(9600);
  Serial.println("Vlaznost i temperatura\n\n");
  delay(1000);




  pinMode(VENT,OUTPUT) ;
}
void loop() {
dht.read11(dht_dpin);

    Serial.print("Vlaznost zraka = ");
    Serial.print(DHT.humidity);
    Serial.print("%  ");
    Serial.print("temperatura = ");
    Serial.print(DHT.temperature); 
    Serial.println("C  ");
    delay(800); 
    
}


void loop()
{
  
  if(dht.temperature > 20) digitalWrite(VENT, HIGH);

}
dht.read11(dht_dpin);

You don't have anything called "dht", but the compiler probably already told you that.

Check out this My friend even i am new ...hope it will help you

#include <dht.h>

dht DHT;

#define DHT11_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("DHT11, \t");
  int chk = DHT.read11(DHT11_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;
    case DHTLIB_ERROR_CONNECT:
        Serial.print("Connect error,\t");
        break;
    case DHTLIB_ERROR_ACK_L:
        Serial.print("Ack Low error,\t");
        break;
    case DHTLIB_ERROR_ACK_H:
        Serial.print("Ack High 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(2000);
}

Yes compiler already told me that but how can i fix it?

rohitturns:
Check out this My friend even i am new ...hope it will help you

AWOL:

dht.read11(dht_dpin);

You don't have anything called "dht", but the compiler probably already told you that.

Yes the compiler told me that but how can i fix it?

Did you read reply #2?

rohitturns:
Check out this My friend even i am new ...hope it will help you

#include <dht.h>

dht DHT;

#define DHT11_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("DHT11, \t");
  int chk = DHT.read11(DHT11_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;
    case DHTLIB_ERROR_CONNECT:
        Serial.print("Connect error,\t");
        break;
    case DHTLIB_ERROR_ACK_L:
        Serial.print("Ack Low error,\t");
        break;
    case DHTLIB_ERROR_ACK_H:
        Serial.print("Ack High 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(2000);
}

The compiler say me that the DHTLIB_OK was not declared in that scope