arduino IDE编写,读温度传感器dht22温度,并且输出到串口监视器中,为啥上传后什么都没有
#include "DHT.h"
#define DHTPIN 22#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
void setup() { Serial.begin(115200); dht.begin();}
void loop() { delay(2000); float temperature = dht.readTemperature(); Serial.print("Temperature: "); Serial.print(temperature); Serial.println(" °C");}
#include "DHT.h"
#define DHTPIN 22#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
void setup() { Serial.begin(115200); dht.begin();}
void loop() { delay(2000); float temperature = dht.readTemperature(); Serial.print("Temperature: "); Serial.print(temperature); Serial.println(" °C");}