#include <DHT.h>
float temp;
float hum;
int buzz =4;
int led =5;
DHT dht(3, DHT22);
void setup() {
// put your setup code here, to run once:
dht.begin();
Serial.begin(9600);
pinMode(buzz, OUTPUT);
pinMode(led, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
temp = dht.readTemperature();
hum = dht.readHumidity();
Serial.println(temp);
Serial.println(hum);
delay(1000);
if (temp > 50){
digitalWrite(buzz, HIGH);
}
else{
digitalWrite(buzz, LOW);
}
if (hum > 50){
digitalWrite(led, HIGH);
}
else{
digitalWrite(led, LOW);
}
}