#include <Wire.h>
#include <Adafruit_GFX.h>
#include<Adafruit_SSD1306.h>
#include<DHT.h>
float t=0;
float h=0;
Adafruit_SSD1306 oled(5);
DHT dht(2,DHT22);
void setup(){
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
oled.clearDisplay();
oled.setTextColor(WHITE);
dht.begin();
}
void loop(){
delay(2000);
t = dht.readTemperature();
oled.clearDisplay();
oled.setTextSize(1);
oled.setCursor(0,0);
oled.print("Temp : ");
oled.print(t);
oled.cp437(true);
oled.write(167);
oled.print("C");
h = dht.readHumidity();
oled.setCursor(0,9);
oled.print("Humidity: ");
oled.print(h);
oled.print("%");
oled.display();
delay(3000);
}