#include "DHT.h"
#include <LiquidCrystal_I2C.h>
#define LED_1 6
#define LED_2 5
#define DHT_PIN 12
#define DHT_TYPE DHT22
DHT dht(DHT_PIN, DHT_TYPE);
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
// put your setup code here, to run once: Serial.begin(115200);
Serial.begin(115200);
dht.begin();
lcd.init();
lcd.backlight();
pinMode(LED_1, OUTPUT);
pinMode(LED_2, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly: float hund dht.readHumidity(); float temp dht.readTemperature();
float humd = dht.readHumidity();
float temp = dht.readTemperature();
digitalWrite(LED_1, temp > 30);
digitalWrite(LED_2, humd < 50);
lcd.setCursor(0, 0);
lcd.print("Temp: "); lcd.print(temp); lcd.print("C");
lcd.setCursor(0, 1);
lcd.print("Humid: "); lcd.print (humd); lcd.print("% ");
}