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

Committer:
Bobty
Date:
Sat Feb 21 19:00:08 2015 +0000
Revision:
8:5980547ae71c
Child:
9:0e103c2f869a
Working with thermometer test code

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Bobty 8:5980547ae71c 1 // Handles OneWire temperature sensors DB18S20
Bobty 8:5980547ae71c 2 // Can handle multiple devices per pin
Bobty 8:5980547ae71c 3 // Rob Dobson, 2015
Bobty 8:5980547ae71c 4
Bobty 8:5980547ae71c 5 #ifndef RdDS18B20__H
Bobty 8:5980547ae71c 6 #define RdDS18B20__H
Bobty 8:5980547ae71c 7
Bobty 8:5980547ae71c 8 #include "mbed.h"
Bobty 8:5980547ae71c 9 #include "Onewire.h"
Bobty 8:5980547ae71c 10
Bobty 8:5980547ae71c 11 #define MAX_BUS_DEVICES 8
Bobty 8:5980547ae71c 12
Bobty 8:5980547ae71c 13 class DS18B20
Bobty 8:5980547ae71c 14 {
Bobty 8:5980547ae71c 15 public:
Bobty 8:5980547ae71c 16 DS18B20(PinName mbedPin);
Bobty 8:5980547ae71c 17 void ReqConvert();
Bobty 8:5980547ae71c 18 double GetTemperature(int addrIdx);
Bobty 8:5980547ae71c 19 void DebugPrintAddress(int addrIdx);
Bobty 8:5980547ae71c 20 void SearchToGetAddresses();
Bobty 8:5980547ae71c 21 int GetNumAddresses()
Bobty 8:5980547ae71c 22 {
Bobty 8:5980547ae71c 23 return _numValidAddresses;
Bobty 8:5980547ae71c 24 }
Bobty 8:5980547ae71c 25 uint8_t* GetAddress(int addrIdx);
Bobty 8:5980547ae71c 26 char* GetAddressStr(int addrIdx);
Bobty 8:5980547ae71c 27
Bobty 8:5980547ae71c 28 private:
Bobty 8:5980547ae71c 29 int _numValidAddresses;
Bobty 8:5980547ae71c 30 uint8_t _addrTable[MAX_BUS_DEVICES][ONEWIRE_ADDR_BYTES];
Bobty 8:5980547ae71c 31 Onewire _oneWire;
Bobty 8:5980547ae71c 32 char _addrStr[3 * ONEWIRE_ADDR_BYTES + 1];
Bobty 8:5980547ae71c 33 };
Bobty 8:5980547ae71c 34
Bobty 8:5980547ae71c 35 #endif