Last active
August 11, 2017 01:51
-
-
Save codemee/9df289a4e098849cd21cc94bb75991fb to your computer and use it in GitHub Desktop.
DHT11 library original 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
// WRITE TO RIGHT VARS | |
// as bits[1] and bits[3] are allways zero they are omitted in formulas. | |
humidity = bits[0]; | |
temperature = bits[2]; | |
uint8_t sum = bits[0] + bits[2]; | |
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