diff --git a/libraries/DHTstable/dht.cpp b/libraries/DHTstable/dht.cpp index 114941f1..d1951067 100644 --- a/libraries/DHTstable/dht.cpp +++ b/libraries/DHTstable/dht.cpp @@ -6,6 +6,7 @@ // URL: https://github.com/RobTillaart/Arduino/tree/master/libraries/DHTstable // // HISTORY: +// 0.2.1 2017-09-20 fix https://github.com/RobTillaart/Arduino/issues/80 // 0.2.0 2017-07-24 fix https://github.com/RobTillaart/Arduino/issues/31 + 33 // 0.1.13 fix negative temperature // 0.1.12 support DHT33 and DHT44 initial version @@ -54,10 +55,11 @@ int dht::read11(uint8_t pin) temperature = bits[2]; // bits[3] == 0; // TEST CHECKSUM - // bits[1] && bits[3] both 0 - uint8_t sum = bits[0] + bits[2]; - if (bits[4] != sum) return DHTLIB_ERROR_CHECKSUM; - + uint8_t sum = bits[0] + bits[1] + bits[2] + bits[3]; + if (bits[4] != sum) + { + return DHTLIB_ERROR_CHECKSUM; + } return DHTLIB_OK; } diff --git a/libraries/DHTstable/dht.h b/libraries/DHTstable/dht.h index bce8040a..855daac8 100644 --- a/libraries/DHTstable/dht.h +++ b/libraries/DHTstable/dht.h @@ -1,7 +1,7 @@ // // FILE: dht.h // AUTHOR: Rob Tillaart -// VERSION: 0.2.0 +// VERSION: 0.2.1 // PURPOSE: DHT Temperature & Humidity Sensor library for Arduino // URL: https://github.com/RobTillaart/Arduino/tree/master/libraries/DHTstable // @@ -18,7 +18,7 @@ #include #endif -#define DHT_LIB_VERSION "0.2.0 - dhtstable" +#define DHT_LIB_VERSION "0.2.1 - dhtstable" #define DHTLIB_OK 0 #define DHTLIB_ERROR_CHECKSUM -1 diff --git a/libraries/DHTstable/library.properties b/libraries/DHTstable/library.properties index f2c3cafc..560f6e07 100644 --- a/libraries/DHTstable/library.properties +++ b/libraries/DHTstable/library.properties @@ -1,5 +1,5 @@ name=DHTStable -version=0.2.0 +version=0.2.1 author=Rob Tillaart maintainer=Rob Tillaart sentence=Stable version of library for DHT Temperature & Humidity Sensor diff --git a/libraries/DHTstable/readme.md b/libraries/DHTstable/readme.md index b16e2873..6089d5ed 100644 --- a/libraries/DHTstable/readme.md +++ b/libraries/DHTstable/readme.md @@ -1,5 +1,5 @@ -This is the 0.2.0 version of the DHTlib. +This is the 0.2.1 version of the DHTlib. This version is stable for both ARM and AVR. You can use most examples from https://github.com/RobTillaart/Arduino/tree/master/libraries/DHTlib/examples