Dallas / Maxim DS1820 1-Wire library. For communication with multiple DS1820 on a single 1-Wire bus. Also supports DS18S20 and DS18B20. This fork fixes a timing problem I had with latest mbed library; allows immediate return from convert_temperature(); tidies up a few other things, including some documentation errors.
Fork of DS1820 by
Revision 4:29264b0a2c9f, committed 2013-08-07
- Comitter:
- pairmand
- Date:
- Wed Aug 07 11:02:10 2013 +0000
- Parent:
- 3:8f2b7f4940b5
- Commit message:
- Added check of CRC to end of search_ROM
Changed in this revision
DS1820.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 8f2b7f4940b5 -r 29264b0a2c9f DS1820.cpp --- a/DS1820.cpp Thu Aug 01 10:18:17 2013 +0000 +++ b/DS1820.cpp Wed Aug 07 11:02:10 2013 +0000 @@ -151,7 +151,10 @@ if (ROM_bit_index != 0xFF) { for(byte_counter=0;byte_counter<8;byte_counter++) ROM[byte_counter] = DS1820_search_ROM[byte_counter]; - return_value = true; + if (ROM_checksum_error()) // Check the CRC + DS1820_last_descrepancy = 0; // Abort any more search + else + return_value = true; } } if (DS1820_last_descrepancy == 0)