Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix for negative temperatures

  • Loading branch information...
commit f0b374ad8c604193b7540f8bc189f3dafb14e7f0 1 parent f1c5b3a
@nathanchantrell authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  DHT22.cpp
View
3  DHT22.cpp
@@ -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
{
Please sign in to comment.
Something went wrong with that request. Please try again.