Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix for negative temperatures

  • Loading branch information...
commit f0b374ad8c604193b7540f8bc189f3dafb14e7f0 1 parent f1c5b3a
Nathan Chantrell authored July 07, 2012

Showing 1 changed file with 1 addition and 2 deletions. Show diff stats Hide diff stats

  1. 3  DHT22.cpp
3  DHT22.cpp
@@ -210,8 +210,7 @@ DHT22_ERROR_t DHT22::readData()
210 210
   {
211 211
     // Below zero, non standard way of encoding negative numbers!
212 212
     // Convert to native negative format.
213  
-    currentTemperature &= 0x7FFF;
214  
-    _lastTemperature = -currentTemperature;
  213
+    _lastTemperature = -currentTemperature & 0x7FFF;
215 214
   }
216 215
   else
217 216
   {

0 notes on commit f0b374a

Please sign in to comment.
Something went wrong with that request. Please try again.