This commit is contained in:
Sergio Pernas 2022-09-06 15:01:02 -03:00
parent 637e744386
commit d015af3cd6
2 changed files with 31 additions and 29 deletions

View file

@ -51,7 +51,7 @@ void loop() {
Serial.write("T"); Serial.write("T");
Serial.write(" "); Serial.write(" ");
Serial.write("00"); Serial.write("00");
Serial.write(""); Serial.write(" ");
Serial.write("C"); Serial.write("C");
Serial.write(" "); Serial.write(" ");
Serial.write("99"); Serial.write("99");
@ -63,7 +63,7 @@ void loop() {
Serial.write("Tur"); Serial.write("Tur");
Serial.write(" "); Serial.write(" ");
Serial.write("123"); Serial.write("123");
Serial.write(""); Serial.write(" ");
Serial.write("TSS"); Serial.write("TSS");
Serial.write(" "); Serial.write(" ");
Serial.write("99"); Serial.write("99");
@ -75,7 +75,7 @@ void loop() {
Serial.write("Con"); Serial.write("Con");
Serial.write(" "); Serial.write(" ");
Serial.write("97"); Serial.write("97");
Serial.write(""); Serial.write(" ");
Serial.write("Con"); Serial.write("Con");
Serial.write(" "); Serial.write(" ");
Serial.write("99"); Serial.write("99");
@ -88,7 +88,7 @@ void loop() {
Serial.write("Ph"); Serial.write("Ph");
Serial.write(" "); Serial.write(" ");
Serial.write("98"); Serial.write("98");
Serial.write(""); Serial.write(" ");
Serial.write("Ph"); Serial.write("Ph");
Serial.write(" "); Serial.write(" ");
Serial.write("99"); Serial.write("99");

View file

@ -46,34 +46,36 @@ void loop() {
switch (inQuery) { switch (inQuery) {
case 1: case 1:
Serial.write("1"); Serial.write("1");
Serial.write(" "); Serial.write(" ");
Serial.write("T"); Serial.write("T");
Serial.write(" "); Serial.write(" ");
char lecturaStr[6]; // Buffer big enough for 7-character float char lecturaStrTemp[6]; // Buffer big enough for 7-character float
dtostrf(getDataTemp(), 2, 4, lecturaStr); // Leave room for too large numbers! dtostrf(getDataTemp(), 2, 4, lecturaStrTemp); // Leave room for too large numbers!
Serial.write(lecturaStr); Serial.write(lecturaStrTemp);
Serial.write(" "); Serial.write(" ");
Serial.write("C"); Serial.write("C");
Serial.write(" "); Serial.write(" ");
Serial.write("99"); Serial.write("99");
break; break;
case 2: case 2:
Serial.write("2"); Serial.write("2");
Serial.write(" "); Serial.write(" ");
Serial.write("Tur"); Serial.write("Tur");
Serial.write(" "); Serial.write(" ");
//char lecturaStr[6]; // Buffer big enough for 7-character float //char lecturaStr[6]; // Buffer big enough for 7-character float
//dtostrf(getData(), 2, 4, lecturaStr); // Leave room for too large numbers! //dtostrf(getData(), 2, 4, lecturaStr); // Leave room for too large numbers!
dtostrf(getDataTur(), 3, 2, lecturaStr); // Leave room for too large numbers! char lecturaStrTur[5]; // Buffer big enough for 7-character float
Serial.write(lecturaStr); dtostrf(getDataTur(), 3, 2, lecturaStrTur); // Leave room for too large numbers!
Serial.write(" ");
Serial.write("TSS"); Serial.write(lecturaStrTur);
Serial.write(" "); Serial.write(" ");
Serial.write("99"); Serial.write("TSS");
Serial.write(" ");
Serial.write("99");
break; break;
case 3: case 3:
@ -82,7 +84,7 @@ void loop() {
Serial.write("Con"); Serial.write("Con");
Serial.write(" "); Serial.write(" ");
Serial.write("97"); Serial.write("97");
Serial.write(""); Serial.write(" ");
Serial.write("Con"); Serial.write("Con");
Serial.write(" "); Serial.write(" ");
Serial.write("99"); Serial.write("99");
@ -95,7 +97,7 @@ void loop() {
Serial.write("Ph"); Serial.write("Ph");
Serial.write(" "); Serial.write(" ");
Serial.write("98"); Serial.write("98");
Serial.write(""); Serial.write(" ");
Serial.write("Ph"); Serial.write("Ph");
Serial.write(" "); Serial.write(" ");
Serial.write("99"); Serial.write("99");