#include <DHT22.h>
#include <SPI.h>
#define pinDATA SDA
DHT22 dht22(pinDATA);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(8, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
float t = dht22.getTemperature();
float h = dht22.getHumidity();
if (h >= 50) {
digitalWrite(8, HIGH);
}
else{
digitalWrite(8, LOW);
}
Serial.print(h);
Serial.print("\n");
delay(500);
}