add receiver
This commit is contained in:
parent
2e06a62e2a
commit
f0805dd48a
23
receive-arduino/receive-arduino.ino
Normal file
23
receive-arduino/receive-arduino.ino
Normal file
@ -0,0 +1,23 @@
|
||||
#include <SoftwareSerial.h>
|
||||
|
||||
SoftwareSerial lora(8, 9); // RX, TX
|
||||
|
||||
String line;
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
lora.begin(9600);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
while (lora.available()) {
|
||||
char c = lora.read();
|
||||
|
||||
if (c == '\n') {
|
||||
Serial.println(line);
|
||||
line = "";
|
||||
} else {
|
||||
line += c;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user