From 281ef8967d04c0d34954558d88a20eb5a6b7cdf8 Mon Sep 17 00:00:00 2001 From: oscgonfer Date: Fri, 17 May 2024 16:31:12 +0200 Subject: [PATCH] Only send compensation in atlas sensors when needed --- sam/src/SckAux.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sam/src/SckAux.cpp b/sam/src/SckAux.cpp index 318b0ca..84c4661 100644 --- a/sam/src/SckAux.cpp +++ b/sam/src/SckAux.cpp @@ -1694,7 +1694,7 @@ bool Atlas::sendCommand(char* command) } bool Atlas::tempCompensation() { - // Temperature comepnsation for PH, EC, and DO + // Temperature compensation for PH, EC, and DO float temperature; if (!ORP) { @@ -1711,11 +1711,12 @@ bool Atlas::tempCompensation() temperature = atlasTEMP.newReading[0]; } - } - char data[10]; - sprintf(data,"T,%.2f",temperature); - if (!sendCommand(data)) return false; + char data[10]; + sprintf(data,"T,%.2f",temperature); + if (!sendCommand(data)) return false; + + } // Salinity compensation only for DO if (DO && atlasEC.detected) {