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_test/LoRaReceiver/LoRaReceiver.ino

29 lines
566 B
Arduino

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