#include "dht.h"
const int DHT22_PIN = 5;
dht DHT;
//將15丟給DHT_PIN
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 20, 4);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("A120E101黃律嘉");
lcd.init();
lcd.backlight();
}
void loop() {
// put your main code here, to run repeatedly:
int chk = DHT.read22(DHT22_PIN);
lcd.setCursor(0, 0);
lcd.print("temp:"+String(DHT.temperature,2)+"C");
lcd.setCursor(0, 1);
lcd.print("humidity:"+String(DHT.humidity,1)+"%");
}