when you use the "#include" before the void setup is that library you list automatically added? because when i used #include<Adafruit_SSD1306.h> and #include <Adafruit_GFX.h> there is no issue but when i used #include <DHT.h> it says there is no directory for it. what did I do wrong?
#include <Adafruit_SSD1306.h>
#include <Adafruit_GFX.h>
#include <DHT.h>
#define DHTPIN 2
#define DHTTYPE DHT11
#define SREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define SCREEN_I2C_ADDRESS 0x3c
#define OLED_RESET_PIN -1
DHT dht(DHTPIN, DHTTYPE);
Adafruit_SSD1306 screen(SREEN_WIDTH, SCREEN_HEIGHT, &Wire,OLED_RESET_PIN);
void setup() {
dht.begin();
screen.begin(SSD1306_SWITCHCAPVCC, SCREEN_I2C_ADDRESS);
}
void loop() {
delay(2000);
float t = dht.readTemperature();
float n = dht.readHumidity();
screen.clearDisplay();
screen.setTextSize(1);
screen.setTextColor(WHITE);
screen.setCursor(0,0);
screen.print("Temperature:");
screen.setCursor(0, 35);
screen.print("Humidity:");
if(isnan(h) || isnan(t)){
screen.setCursor(0, 32);
screen.print("Failed to read from DHT sensor!");
screen.dsiplay();
return;
}
screen.setCursor(0, 12);
screen.setTextSize(2);
screen.print(t);
screen.print((char)247);
screen.display("C");
screen.setCursor(0, 47);
screen.print(h);
screen.print(" %");
screen.display();
}
i'm currently following a humidity sensor oled display tutorial and i've gotten stuck,
thanks in advance