#include "DHT.h"
DHT dht(2, DHT22);
int buzzer = 9;
void setup()
{
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(buzzer, OUTPUT);
dht.begin();
}
void loop()
{
// put your main code here, to run repeatedly:
float T = dht.readTemperature();
float H = dht.readHumidity();
float Temperature = dht.readTemperature();
float Humidity = dht.readHumidity();
if((T>30) || (H<70))
{tone(buzzer, 4000);}
else
{noTone(buzzer);}
Serial.println(T);
Serial.println(H);
delay(100);
}