From 2f48bc72a386f3c1377bd026de0f2c552c5b3438 Mon Sep 17 00:00:00 2001 From: jlino Date: Fri, 23 Jun 2017 17:42:04 +0100 Subject: [PATCH] forced measured temperature to be above 0 --- Temperature.cpp | 6 +++--- Temperature.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Temperature.cpp b/Temperature.cpp index cfa6c23..b75d264 100644 --- a/Temperature.cpp +++ b/Temperature.cpp @@ -34,8 +34,8 @@ Temperature::Temperature(const char *name, _measuredTemperatureDeviation = 0.0; _pump = false; - analogReference(INTERNAL1V1); // EXTERNAL && INTERNAL2V56 && INTERNAL1V1 - pinMode(_OutputPin_SensorPower, OUTPUT); // setup temperature sensor input pin + analogReference(INTERNAL1V1); // EXTERNAL && INTERNAL2V56 && INTERNAL1V1 + pinMode(_OutputPin_SensorPower, OUTPUT); // setup temperature sensor input pin digitalWrite(_OutputPin_SensorPower, LOW); // initialize sensor on } @@ -177,7 +177,7 @@ float Temperature::GetMode(float new_array[]) { } float Temperature::getCurrentTemperature() { - return _measuredTemperature; // - 4.41; + return _measuredTemperature>0.0?_measuredTemperature:0.0; // - 4.41; } float Temperature::setPumpStatus( bool pump ) { diff --git a/Temperature.h b/Temperature.h index 8bb7fdd..7137779 100644 --- a/Temperature.h +++ b/Temperature.h @@ -8,7 +8,7 @@ #include "Arduino.h" -#define DEBUG +//#define DEBUG #define CONSTANT_ADC_STEP_COUNT 1024.0 -- 2.24.1