#include <DHT.h>
#define DHT11_PIN 3       
DHT dht(DHT11_PIN, DHT11);   //实例化温湿度对象为DHT   Instantiate the temperature and humidity object as a dht

void setup()
{
  Serial.begin(115200);
  pinMode(DHT11_PIN,INPUT);
  dht.begin(); //DHT Start to work}
}
void loop() {
  // 读取温湿度数据
  float temperature = dht.readTemperature();
  float humidity = dht.readHumidity();
  Serial.print("Temperature: ");// temperature
  Serial.print(temperature);
  Serial.print(" ℃ ");
  Serial.print("Humidity: ");//humidity
  Serial.print(humidity);
  Serial.println("%");
}
