-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels