This commit is contained in:
Sergio Pernas 2022-09-06 13:50:50 -03:00
parent ce2e217e72
commit cc0ff602eb

View file

@ -46,59 +46,66 @@ void loop() {
switch (inQuery) { switch (inQuery) {
case 1: case 1:
Serial.write("1"); Serial.write("1");
Serial.write(" ");
Serial.write("T");
Serial.write(" ");
char lecturaStr[6]; // Buffer big enough for 7-character float
dtostrf(getDataTemp(), 2, 4, lecturaStr); // Leave room for too large numbers!
Serial.write(lecturaStr);
Serial.write(" ");
Serial.write("C");
Serial.write(" ");
Serial.write("99");
break;
case 2:
Serial.write("2");
Serial.write(" ");
Serial.write("Tur");
Serial.write(" ");
//char lecturaStr[6]; // Buffer big enough for 7-character float
//dtostrf(getData(), 2, 4, lecturaStr); // Leave room for too large numbers!
dtostrf(getDataTur(), 3, 2, lecturaStr); // Leave room for too large numbers!
Serial.write(lecturaStr);
Serial.write(" ");
Serial.write("TSS");
Serial.write(" ");
Serial.write("99");
break;
case 3:
Serial.write("3");
Serial.write(" "); Serial.write(" ");
Serial.write("T"); Serial.write("Con");
Serial.write(" "); Serial.write(" ");
Serial.write("26.3"); Serial.write("26");
Serial.write(" "); Serial.write("3425");
Serial.write("C"); Serial.write("Con");
Serial.write(" "); Serial.write(" ");
Serial.write("99"); Serial.write("99");
break; break;
case 2:
Serial.write("2");
Serial.write(" ");
Serial.write("Tur");
Serial.write(" ");
Serial.write("26");
Serial.write("1235");
Serial.write("TSS");
Serial.write(" ");
Serial.write("99");
break; case 4:
case 3: Serial.write("4");
Serial.write("3"); Serial.write(" ");
Serial.write(" "); Serial.write("Ph");
Serial.write("Con"); Serial.write(" ");
Serial.write(" "); Serial.write("26");
Serial.write("26"); Serial.write("3425");
Serial.write("3425"); Serial.write("Ph");
Serial.write("Con"); Serial.write(" ");
Serial.write(" "); Serial.write("99");
Serial.write("99");
break;
case 4:
Serial.write("4");
Serial.write(" ");
Serial.write("Ph");
Serial.write(" ");
Serial.write("26");
Serial.write("3425");
Serial.write("Ph");
Serial.write(" ");
Serial.write("99");
break; break;
default: default:
; ;
} }
} }
delay(100); delay(100);
} }