Skip to content

Commit

Permalink
Update DHT22.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilskoczylas authored Jul 31, 2024
1 parent ec8c33e commit 97b531d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions DHT22.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,9 @@ def translateSignal(self, timeArray):
# i = 17 is only sign digit: +/-
if i == 16:
sign = -1

if i in range (17, 32):

# skipping 17-21 bits, because temperature cannot be as high but it detects errors
if i in range (22, 32):
temperature += (1 << (31 - i))

if i in range (32, 40):
Expand Down

0 comments on commit 97b531d

Please sign in to comment.