GSOE Belueftung DS18B20

Dependencies:   LCD_i2c_GSOE DS1820

Files at this revision

API Documentation at this revision

Comitter:
hudakz
Date:
Thu Mar 19 19:25:49 2015 +0000
Child:
1:fe12bf2ad337
Commit message:
Initial revision

Changed in this revision

DS1820.lib Show annotated file Show diff for this revision Revisions of this file
OneWire.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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DS1820.lib	Thu Mar 19 19:25:49 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/hudakz/code/DS1820/#a250babd0a9f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OneWire.lib	Thu Mar 19 19:25:49 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/hudakz/code/OneWire/#acf75feb0947
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Mar 19 19:25:49 2015 +0000
@@ -0,0 +1,24 @@
+/*
+ * Simple DS1820 sensor demo
+ */
+ 
+#include "mbed.h"
+#include "DS1820.h"
+
+Serial serial(USBTX, USBRX);
+
+int main() {
+    DS1820  ds1820(PA_9);
+    
+    // detect and initialize DS1820 sensor
+    if(ds1820.begin()) {
+        ds1820.startConversion();       // start temperature conversion
+        wait(1.0);                      // wait to complete temperature conversion
+        while(1) {
+            serial.printf("temp = %3.1f\r\n", ds1820.read());   // read temperature
+            ds1820.startConversion();   // start temperature conversion
+            wait(1.0);                  // wait to complete temperature conversion
+        }
+    } else
+        serial.printf("No DS1820 sensor found!\r\n");
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Mar 19 19:25:49 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/7e07b6fb45cf
\ No newline at end of file