You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Testing several iteration always the first read fails.
After some google search I found https://github.com/winlinvip/SimpleDHT which has a well documented sequence reading the temp data.
I adapted the init sequence to the same way SimpleDHT does.
After that the read always works on the first attempt.
Snippet from dht22.c
pinMode(DHTPIN, OUTPUT);
//digitalWrite(DHTPIN, HIGH);
//delay(10);
digitalWrite(DHTPIN, LOW);
delay(20);
// then pull it up for 20-40 microseconds
digitalWrite(DHTPIN, HIGH);
delayMicroseconds(25);
// prepare to read the pin
pinMode(DHTPIN, INPUT);
----<>---
If not called frequent it works with my setup everytime.
Attached dht22.c as txt since github wont allow .c dht22.txt
The text was updated successfully, but these errors were encountered:
Testing several iteration always the first read fails.
After some google search I found https://github.com/winlinvip/SimpleDHT which has a well documented sequence reading the temp data.
I adapted the init sequence to the same way SimpleDHT does.
After that the read always works on the first attempt.
Snippet from dht22.c
pinMode(DHTPIN, OUTPUT);
//digitalWrite(DHTPIN, HIGH);
//delay(10);
digitalWrite(DHTPIN, LOW);
delay(20);
// then pull it up for 20-40 microseconds
digitalWrite(DHTPIN, HIGH);
delayMicroseconds(25);
// prepare to read the pin
pinMode(DHTPIN, INPUT);
----<>---
If not called frequent it works with my setup everytime.
Attached dht22.c as txt since github wont allow .c
dht22.txt
The text was updated successfully, but these errors were encountered: