-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DHT & optimizations #2748
DHT & optimizations #2748
Conversation
@@ -151,7 +151,7 @@ bool P005_do_plugin_read(struct EventStruct *event) { | |||
digitalWrite(Plugin_005_DHT_Pin, LOW); // Pull low | |||
|
|||
switch (Par3) { | |||
case P005_DHT11: delay(18); break; // minimum 18ms | |||
case P005_DHT11: delay(19); break; // minimum 18ms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always get a bit nervous by these kind of fixes.
Delay from 18 to 19 msec....
If this really is needed, then the timing is way too critical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we discussed this once, it should be 18 minimum, so 19 is not big deal, for dht22 minimum is 1ms and 2ms works ok,
actually it is hard to buy dht11
in fact in one wire protocols timings are critical
we can add delay(0) before turning of interrupts, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can add delay(0) before turning of interrupts, what do you think?
That sounds like a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TD-er about 1ms more, it is also better for longer wires
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TD-er bad idea with delay, because we have already delays just before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it depends, is the delay from the switch statement just critical as minimum, or also for the maximum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TD-er first delay is start condition - request for data and it is minimum critical, every next should not be more than in documentation so critical for maximum.
we still don't know how accurate delays are in esp8266 from poor quality boards to nice ones.
#2745