well, you can use the code from there which you said is working.
I have posted the code that is working with my old NodeMCU (v2), but it is not working with NodeMCU (v3).
So i asked if you can help me or not ?
are you sure the code posted there is not working? the code you posted up is different from there.
Yes, the code that i posted earlier is working with my old ESP8266
i am sure it won’t work with v2 or v3 , as there is nothing as #define DHTTYPE AM2301
in the DHT library you used. So can you use the code I gave you earlier and try. And this is much I can help you.
Sir, i am using the code that i posted earlier and it is working.
The code that you send me is not working
Glad to hear it is working.
Yes, but i don’t know what’s the problem ?
can you try this code and see if this works
#include <DHT.h>
#define DHTPIN 12 // Digital pin connected to the DHT sensor
#define DHTTYPE DHT21 // DHT 21 (AM2301)
DHT dht(DHTPIN, DHTTYPE); // Initialize DHT sensor.
void setup() {
Serial.begin(9600);
dht.begin();
}
void loop() {
float temp = dht.readTemperature();
float hum = dht.readHumidity();
Serial.println(temp);
Serial.println(hum);
}
No. it now working with ESP8266 v3…I have bought 4 pieces ESP8266 v3 and no one is working.
can you share a screenshot of the serial monitor?
not sure what is going on here, it can any one of the issue from here [SOLVED] DHT11/DHT22 - Failed to read from DHT sensor | Random Nerd Tutorials
or you can try another library [SOLVED] DHT11/DHT22 - Failed to read from DHT sensor | Random Nerd Tutorials
I have seen this link and i have checked everything.
Which library do you prefer me to use ?
Its not working.
sorry, i am not sure what is the issue and cannot help you.
is it possible that boards are with defect ?
Idk, it can be DHT sensor and library issue also.
DHT sensor is working with other boards