Created
August 11, 2017 01:52
-
-
Save codemee/5459a12bb166446ca7c52c0cd2a33ed2 to your computer and use it in GitHub Desktop.
DHT11 modified checksum code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add bits[1] and bits[3] back to formulas to compute correct checksum. | |
humidity = bits[0]; | |
temperature = bits[2]; | |
uint8_t sum = bits[0] + bits[1] + bits[2] + bits[3]; | |
if (bits[4] != sum) return DHTLIB_ERROR_CHECKSUM; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment