Monitor for central heating system (e.g. 2zones+hw) Supports up to 15 temp probes (DS18B20/DS18S20) 3 valve monitors Gas pulse meter recording Use stand-alone or with nodeEnergyServer See http://robdobson.com/2015/09/central-heating-monitor

Dependencies:   EthernetInterfacePlusHostname NTPClient Onewire RdWebServer SDFileSystem-RTOS mbed-rtos mbed-src

Revision:
8:5980547ae71c
Child:
9:0e103c2f869a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RdDS18B20.h	Sat Feb 21 19:00:08 2015 +0000
@@ -0,0 +1,35 @@
+// Handles OneWire temperature sensors DB18S20
+// Can handle multiple devices per pin
+// Rob Dobson, 2015
+
+#ifndef RdDS18B20__H
+#define RdDS18B20__H
+
+#include "mbed.h"
+#include "Onewire.h"
+
+#define MAX_BUS_DEVICES 8
+
+class DS18B20
+{
+public:
+    DS18B20(PinName mbedPin);
+    void ReqConvert();
+    double GetTemperature(int addrIdx);
+    void DebugPrintAddress(int addrIdx);
+    void SearchToGetAddresses();
+    int GetNumAddresses()
+    {
+        return _numValidAddresses;
+    }
+    uint8_t* GetAddress(int addrIdx);
+    char* GetAddressStr(int addrIdx);
+    
+private:
+    int _numValidAddresses;
+    uint8_t _addrTable[MAX_BUS_DEVICES][ONEWIRE_ADDR_BYTES];
+    Onewire _oneWire;
+    char _addrStr[3 * ONEWIRE_ADDR_BYTES + 1];
+};
+
+#endif
\ No newline at end of file