LoRaGateway_BTS2A/lora vers arduino/LoRaReceiver/LoRaReceiver.ino
flavienhaas e49d11c98d MAJ SPI
2018-04-12 14:55:36 +02:00

29 lines
516 B
C++

#include <SPI.h>
#include <LoRa.h>
void setup() {
SerialUSB.begin(9600);
while (!SerialUSB){};
SerialUSB.println("LoRa Receiver");
//if (!LoRa.begin(868E6)) {
// Serial.println("Starting LoRa failed!");
// while (1);
//}
}
void loop() {
int packetSize = LoRa.parsePacket();
if (packetSize > 0) {
for (int i = 0; i < packetSize; i++)
{
SerialUSB.println((char)LoRa.read());
}
//Serial.print("with RSSi");
//Serial.println(LoRa.packetRssi());
delay(100);
}
}