From 8c3c46056f3a7bca2380fe2e16ea80074aeeb5d4 Mon Sep 17 00:00:00 2001 From: Sergio Pernas Date: Mon, 23 May 2022 09:39:48 -0300 Subject: [PATCH] update --- 0x03-conductividad/0x03-conductuvidad | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 0x03-conductividad/0x03-conductuvidad diff --git a/0x03-conductividad/0x03-conductuvidad b/0x03-conductividad/0x03-conductuvidad new file mode 100644 index 0000000..3162326 --- /dev/null +++ b/0x03-conductividad/0x03-conductuvidad @@ -0,0 +1,42 @@ + +// Dispositivo +char devIDstr[5]; +int inQuery; + + + +void setup() { + Serial.begin(9600); +} + + +void loop() { + + Serial.write("\n"); + delay(1000); + + if ( Serial.available() > 0) { + inQuery = Serial.read(); + + if ( inQuery == devID) { + + Serial.write(itoa(devID, devIDstr, 10)); + 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! + char lecturaStr[5]; // Buffer big enough for 7-character float + dtostrf(getData(), 3, 2, lecturaStr); // Leave room for too large numbers! + + Serial.write(lecturaStr); + Serial.write(" "); + Serial.write("TSS"); + Serial.write(" "); + Serial.write("99"); + + } + } + +}