#include <DHT.h>
#define DHT pin2
#define DHT type DHT11
#define LED-PIN13
#define BUTTON-PIN7
DHT dht (DHTPIN<DHT type);
void setup()
{
pinMode(LED-PIN,OUTPUT);
PINMODE(BUTTON-PIN,INPUT);
dht Begin();
serial begin(9600);
}
void loop()
{
intbutton state = digital read (Button-PIN);
floot temparature = dht read Temparature();
floot humidity + dht.read Humidity();
if(button state ==HIGH//temparature >30)
{
digital write[LED-PIN.HIGH];
}
else
{
digitalwrite(LED-PIN.HIGH);
}
serial.print("Temparature:")'
serial.print(temparature);
serial.print(".c Humidity:");
serial.print(humidity);
serial.println("%");
delay(2000);
}
I2luY2x1ZGUgPERIVC5oPgojZGVmaW5lIERIVCBwaW4yCiNkZWZpbmUgREhUIHR5cGUgREhUMTEKI2RlZmluZSBMRUQtUElOMTMKI2RlZmluZSBCVVRUT04tUElONwpESFQgZGh0IChESFRQSU48REhUIHR5cGUpOwp2b2lkIHNldHVwKCkKewogIHBpbk1vZGUoTEVELVBJTixPVVRQVVQpOwogIFBJTk1PREUoQlVUVE9OLVBJTixJTlBVVCk7CiAgZGh0IEJlZ2luKCk7CiAgc2VyaWFsIGJlZ2luKDk2MDApOyAKfQp2b2lkIGxvb3AoKQp7CiAgaW50YnV0dG9uIHN0YXRlID0gZGlnaXRhbCByZWFkIChCdXR0b24tUElOKTsKICBmbG9vdCB0ZW1wYXJhdHVyZSA9IGRodCByZWFkIFRlbXBhcmF0dXJlKCk7CiAgZmxvb3QgaHVtaWRpdHkgKyBkaHQucmVhZCBIdW1pZGl0eSgpOwogIGlmKGJ1dHRvbiBzdGF0ZSA9PUhJR0gvL3RlbXBhcmF0dXJlID4zMCkKewpkaWdpdGFsIHdyaXRlW0xFRC1QSU4uSElHSF07Cn0KZWxzZQp7CiAgZGlnaXRhbHdyaXRlKExFRC1QSU4uSElHSCk7Cn0Kc2VyaWFsLnByaW50KCJUZW1wYXJhdHVyZToiKScKc2VyaWFsLnByaW50KHRlbXBhcmF0dXJlKTsKc2VyaWFsLnByaW50KCIuYyBIdW1pZGl0eToiKTsKc2VyaWFsLnByaW50KGh1bWlkaXR5KTsKc2VyaWFsLnByaW50bG4oIiUiKTsKZGVsYXkoMjAwMCk7Cn0=