Harshad Chirutkar / Mbed 2 deprecated DS18B20_HGC

Dependencies:   mbed DS18B20

Files at this revision

API Documentation at this revision

Comitter:
hgc_8421
Date:
Fri Jun 15 16:03:54 2012 +0000
Commit message:
Initial

Changed in this revision

DS18B20.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 487c492ca69a DS18B20.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DS18B20.lib	Fri Jun 15 16:03:54 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/kriedel/code/DS18B20/#21c0c97a5d7c
diff -r 000000000000 -r 487c492ca69a main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jun 15 16:03:54 2012 +0000
@@ -0,0 +1,27 @@
+#include "mbed.h"
+#include "DS18B20.h"
+#include "OneWireDefs.h"
+#define THERMOMETER DS18B20
+DigitalOut myled(LED1);
+
+int main() {
+//          device( crcOn, useAddress, parasitic, mbed pin )
+    THERMOMETER device(true, true, false, p25);
+    
+    while (!device.initialize());    // keep calling until it works
+    while(1) {
+        // changing the resolutions only affects the DS18B20. The DS18S20 is fixed.
+        device.setResolution(nineBit);
+        device.readTemperature(); 
+        wait(5);
+        device.setResolution(tenBit);
+        device.readTemperature(); 
+        wait(5);
+        device.setResolution(elevenBit);
+        device.readTemperature(); 
+        wait(5);
+        device.setResolution(twelveBit);
+        device.readTemperature(); 
+        wait(5);
+    }
+}
diff -r 000000000000 -r 487c492ca69a mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Jun 15 16:03:54 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/078e4b97a13e