Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from nathanchantrell/master
Browse files Browse the repository at this point in the history
Fix for DHT_ERROR_CHECKSUM with negative temperatures
  • Loading branch information
Craig Ringer committed Jul 16, 2012
2 parents f1c5b3a + f0b374a commit 7fa6ba8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions DHT22.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,7 @@ DHT22_ERROR_t DHT22::readData()
{
// Below zero, non standard way of encoding negative numbers!
// Convert to native negative format.
currentTemperature &= 0x7FFF;
_lastTemperature = -currentTemperature;
_lastTemperature = -currentTemperature & 0x7FFF;
}
else
{
Expand Down

0 comments on commit 7fa6ba8

Please sign in to comment.