Library for reading temperature from DS1820, DS18B20 and DS1822

Dependencies:   LinkedList

Dependents:   heatmap BLE_Temperature BLE_Temperature_Exercise F334andDS18B20 ... more

Fork of DS1820 by David Pairman

HelloWorld: http://mbed.org/users/Sissors/code/DS1820_HelloWorld/

Library should currently work on all mbed targets, let me know if there is an issue. First however make sure you have latest version of mbed library and this library.

Revision:
7:58b61681818f
Parent:
6:abfdd851218a
Child:
11:1a3c3002b50c
diff -r abfdd851218a -r 58b61681818f DS1820.h
--- a/DS1820.h	Wed Apr 02 19:10:34 2014 +0000
+++ b/DS1820.h	Tue Apr 08 09:59:18 2014 +0000
@@ -54,6 +54,10 @@
     enum devices{
         this_device,     // command applies to only this device
         all_devices };   // command applies to all devices
+    
+    enum {
+        invalid_conversion = -1000
+    };
 
     /** Create a probe object connected to the specified pins
     *
@@ -91,7 +95,7 @@
       * probe to read its RAM, do CRC check and convert temperature on the LPC1768.
       *
       * @param scale, may be either 'c' or 'f'
-      * @returns temperature for that scale, or -1000.0 if CRC error detected.
+      * @returns temperature for that scale, or DS1820::invalid_conversion (-1000) if CRC error detected.
       */
     float temperature(char scale='c');