Commit 3c63797
Fix negative temperatures for DHT22 (#16)
This commit fixes issue #14
The MSB carries the sign information, which is filtered with `& 0x8000`. If the flag is present, the remainder will get multiplied by `-1`.
All the remaining bits contain the value and are filtered with `& 0x7FFF`.1 parent 5e91c5d commit 3c63797
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| |||
0 commit comments