hello! ive been working on this code and its given me the error message
"arduino_code_v1:25:17: error: cannot convert 'DHT::read' from type 'bool (DHT:: )(bool)' to type 'float'
float t = dht.read Temperature();"
I don't know what this means and I have a feeling I may have made some other errors too, the circuit is the mega, a 128x64 OLED and a DHT11 temp and humidity sensor, here's the code, will greatly appreciate any help
#include "Adafruit_GFX.h"
#include "Adafruit_SSD1306.h"
#include "DHT.h"
#define DHTPIN 2
#define OLED_RESET 20
Adafruit_SSD1306 display(OLED_RESET);
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin (115200);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.display();
delay(2000);
display.clearDisplay();
dht.begin();
delay(2000);
}
void loop() {
float h = dht.readHumidity();
float t = dht.read Temperature();
float f = dht.readTemperature(true);
if (isnan(h) || isnan(t) || isnan(f)) {
delay(2000);
} else{
char temp_buff[5]; char hum_buff[5];
char temp_disp_buff[11] = "Tmp:";
char hum_disp_buff[11] = "Hum:";
dtostrf(t,2,1,temp_buff);
strcat(temp_disp_buff,temp_buff);
dtostrf(h,2,1,hum_buff);
strcat(hum_disp_buff,hum_buff);
display.clearDisplay();
display.setTextSize(2);
display.setTextColor(WHITE);
display.setCursor(0,0);
display.println(temp_disp_buff);
display.println(hum_disp_buff);
display.display();
delay(2000);
}
}
[code]