| #include <LiquidCrystal.h> #include <dht11.h>
 #define DHT11PIN 8
 int Buzzer=7;
 int Led=10;
 dht11 DHT11;
 // initialize the library with the numbers of the interface pins
 LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
 
 void setup() {
 pinMode(DHT11PIN,OUTPUT);
 pinMode(Buzzer,OUTPUT);
 pinMode(Led,OUTPUT);
 Serial.begin(115200);
 
 // set up the LCD's number of columns and rows:
 lcd.begin(16, 2);
 }
 
 void loop() {
 //int chk = DHT11.read(DHT11PIN);
 lcd.setCursor(0, 0);
 lcd.print("Tep: ");
 lcd.print((float)DHT11.temperature, 2);
 lcd.print("C");
 // set the cursor to column 0, line 1
 // (note: line 1 is the second row, since counting begins with 0):
 lcd.setCursor(0, 1);
 // print the number of seconds since reset:
 lcd.print("Hum: ");
 lcd.print((float)DHT11.humidity, 2);
 lcd.print("%");
 delay(200);
 
 int chk = DHT11.read(DHT11PIN);
 Serial.print("yeelink:");
 Serial.println(DHT11.temperature, 1);
 
 if(DHT11.humidity<35.00)
 {
 digitalWrite(Led,LOW);
 }
 else
 {
 digitalWrite(Led,HIGH);
 delay( 500);
 digitalWrite(Led,LOW);
 delay( 500);
 }
 
 if(DHT11.temperature>25)
 {
 digitalWrite(Buzzer,LOW);
 }
 else
 {
 digitalWrite(Buzzer,HIGH);
 delay(15);
 digitalWrite(Buzzer,LOW);
 delay(1);
 }
 delay(1000);
 }
 
 
 
 |