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
Diff: Thermometers.cpp
- Revision:
- 19:0367cb46d003
- Parent:
- 16:89778849e9f7
- Child:
- 20:7933076df5af
--- a/Thermometers.cpp Mon Sep 28 11:16:46 2015 +0000 +++ b/Thermometers.cpp Mon Oct 05 14:05:33 2015 +0000 @@ -4,6 +4,7 @@ #include "Thermometers.h" #define SHOW_THERMOMETER_DEBUGGING 1 +const int DEBUG_EXPECTED_THERMOMETER_COUNT = 3; Thermometers::Thermometers(int numTempSensorPins, const PinName tempSensorPins[], int serviceIntervalInMs) { @@ -47,7 +48,7 @@ { DS18B20* pThermBus = _thermometerBuses[busIdx]; int numTherms = pThermBus->SearchToGetAddresses(); - if (numTherms != 3) + if (numTherms != DEBUG_EXPECTED_THERMOMETER_COUNT) _failAddrCount++; } } @@ -58,7 +59,7 @@ } else { - // Check if time to request thermometer readings + // Check if time to request thermometers to take readings if (_countForThermReadings == loopCountForRequestingThermReading) { #ifdef SHOW_THERMOMETER_DEBUGGING @@ -75,7 +76,7 @@ } } - // Read thermometers + // Check if it is time to get the values from the thermometers if (_countForThermReadings > numLoopsPerThermReading) { _countForThermReadings = 0;