#include <DHT.h>
DHT temp(9,DHT22);

void setup(){
  temp.begin();
  pinMode(6, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(13, OUTPUT);
  Serial.begin(9600);
}

void loop(){
  float h = temp.readHumidity();
  float t = temp.readTemperature();
  //Serial.print("Humidity: ");
  //Serial.println(h);
  //Serial.print("Temperature: ");
  Serial.println(t);
  if(t< 10 || t > 30){
    digitalWrite(5, HIGH);
    digitalWrite(6, LOW);
    tone(13,600);
  }
  else {
    digitalWrite(5, LOW);
    digitalWrite(6, HIGH);
    noTone(13);
  }
  delay(1000);
}