error in programming

I am new on Arduino but osme tomes have error in programming. one of them is: class DHT has no member nmaed 'compute Heatindex' who can help me to solve my problem?

You need to post your code using the </> tags.
Have you looked for errors near where Heatindex is used?

You need to post all your code using the </> tags.
Is there an instance of dht?

my error is: ‘class DHT’ has no member ‘compute HeatIndex’ also this line color will chang to pink:

float hic = dht.computeHeatIndex(t, h, false);

my full code is:

// ****** Start of TM1637 Display code
#include <Arduino.h>
#include <TM1637Display.h>
// Module connection pins (Digital Pins)
#define CLK 2
#define DIO 3
// The amount of time (in milliseconds) between tests
#define TEST_DELAY 1000
TM1637Display display(CLK, DIO);
// ****** end of TM1637 Display code

// Example testing sketch for various DHT humidity/temperature sensors
// Written by ladyada, public domain
// updated by Ahmad Nejrabi for videos.
// on Jan 07, 2018 in Ajax, Ontario, Canada

// ****** Start of DHT code
#include “DHT.h”
#define DHTPIN 9 // what digital pin we’re connected to
// Uncomment whatever type you’re using!
//#define DHTTYPE DHT11 // DHT 11
#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
//#define DHTTYPE DHT21 // DHT 21 (AM2301)
// ********** end of DHT22 code

void setup()
Serial.println(“DHT22 Robojax Test with Display”);
digitalWrite(8,HIGH);// gives 5v for DHT22

void loop()
delay(TEST_DELAY);// wait
// **** TM1637 code start
display.setBrightness(0x0f);// set brightness
uint8_t data = { 0x0, 0x0, 0x0, 0x0 };// clear display values
display.setSegments(data);//clear display
// **** TM1637 code end

// test video

int temp = round(getTemp(“h”));

display.showNumberDec(temp, false, 3,1);

}// loop end


  • getTemp(String req)
  • returns the temprature related parameters
  • req is string request
  • This code can display temprature in:
  • getTemp(“c”) is used to get Celsius
  • getTemp(“f”) is used to get fahrenheit
  • getTemp(“k”) is used for Kelvin
  • getTemp(“hif”) is used to get fahrenheit
  • getTemp(“hic”) is used to get Celsius
  • getTemp(“f”) is used to get humidity
  • written by Ahmad Nejrabi for on Jan 07, 2018
  • in Ajax, Ontario, Canada
    float getTemp(String req)

// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds ‘old’ (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius (the default)
float t = dht.readTemperature();
// Read temperature as Fahrenheit (isFahrenheit = true)
float f = dht.readTemperature(true);

// Compute heat index in Fahrenheit (the default)
float hif = dht.computeHeatIndex(f, h);
// Compute heat index in Celsius (isFahreheit = false)
float hic = dht.computeHeatIndex(t, h, false);

// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println(“Failed to read from DHT sensor!”);
// Compute heat index in Kelvin
float k = t + 273.15;
if(req ==“c”){
return t;//return Cilsus
}else if(req ==“f”){
return f;// return Fahrenheit
}else if(req ==“h”){
return h;// return humidity
}else if(req ==“hif”){
return hif;// return heat index in Fahrenheit
}else if(req ==“hic”){
return hic;// return heat index in Cilsus
}else if(req ==“k”){
return k;// return temprature in Kelvin
return 0.000;// if no reqest found, retun 0.000

any help will be appreciated.

I think you have the wrong DHT library. I don't get that error. Try Sketch->Include Library->Manage Libraries... Set the filter to "DHT" and install "DHT sensor library by Adafruit" or "SimpleDHT by Winlin". I have both installed and one of them is the right one for your sketch.

@media1328, please do not cross-post. Threads merged.

...and please read Reply #1 It’s pretty easy.

Hi, Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.,148850.0.html then look down to item #7 about how to post your code. It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom... :)