Skip to content

Commit

Permalink
Merge pull request #12256 from AlfaBravoX/patch-2
Browse files Browse the repository at this point in the history
Improving SI7021 reading reliability by adjusting timers
  • Loading branch information
arendst authored Jun 1, 2021
2 parents a89274c + 6182df2 commit e59ce3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tasmota/xsns_06_dht.ino
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ bool DhtRead(uint32_t sensor)
delayMicroseconds(50);
break;
case GPIO_SI7021: // iTead SI7021
delayMicroseconds(20); // See: https://github.com/letscontrolit/ESPEasy/issues/1798
delayMicroseconds(30); // See: https://github.com/letscontrolit/ESPEasy/issues/1798 and https://github.com/arendst/Tasmota/issues/12180
break;
}

Expand Down Expand Up @@ -136,7 +136,7 @@ bool DhtRead(uint32_t sensor)
if (DhtWaitState(sensor, 0) && DhtWaitState(sensor, 1) && DhtWaitState(sensor, 0)) {
for (i = 0; i < 40; i++) {
if (!DhtWaitState(sensor, 1)) { break; }
delayMicroseconds(35); // Was 30
delayMicroseconds(32); // Was 30
if (digitalRead(Dht[sensor].pin)) {
dht_data[i / 8] |= (1 << (7 - i % 8));
}
Expand Down

0 comments on commit e59ce3d

Please sign in to comment.