You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
LoRaGateway_BTS2A/lora vers arduino/LoRaReceiver/LoRaReceiver.ino

30 lines
524 B
Arduino

7 years ago
#include <SPI.h>
#include <LoRa.h>
void setup() {
Serial.begin(9600);
while (!Serial);
Serial.println("LoRa Receiver");
7 years ago
if (!LoRa.begin(868E6)) {
7 years ago
Serial.println("Starting LoRa failed!");
while (1);
}
}
void loop() {
// try to parse packet
int packetSize = LoRa.parsePacket();
if (packetSize) {
// read packet
while (LoRa.available()) {
Serial.print((char)LoRa.read());
}
// print RSSI of packet
//Serial.print("' with RSS
//Serial.println(LoRa.packetRssi());
}
}