From 2e06a62e2aa67c87bbea68629d5f343c8b804be7 Mon Sep 17 00:00:00 2001 From: smayzy Date: Sun, 3 May 2026 17:15:41 +0200 Subject: [PATCH] add lora passthrough for uart stream --- cocomobile-arduino/cocomobile-arduino.ino | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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; + } + } +}