diff --git a/cocomobile-arduino/cocomobile-arduino.ino b/cocomobile-arduino/cocomobile-arduino.ino index 1ea0cfc..f4fc254 100644 --- a/cocomobile-arduino/cocomobile-arduino.ino +++ b/cocomobile-arduino/cocomobile-arduino.ino @@ -8,6 +8,8 @@ SoftwareSerial lora(8, 9); // RX, TX float tens = 0; float amp = 0; +String line; + void setup() { lora.begin(9600); Serial.begin(115200); @@ -21,5 +23,14 @@ void loop() { Serial.print(","); Serial.println(amp); - lora.println(); -} \ No newline at end of file + while (Serial.available()) { + char c = Serial.read(); + + if (c == '\n') { + lora.println(line); + line = ""; + } else { + line += c; + } + } +}