读温度传感器dht22温度
esp32吧
全部回复
仅看楼主
level 1
dsbsdfs 楼主
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");}
2024年11月23日 07点11分 1
吧务
level 11
串口有输出吗?
2024年11月25日 00点11分 2
没有
2024年11月25日 00点11分
@dsbsdfs 先研究下串口,最起码能打印一些基本信息。
2024年11月25日 02点11分
1