33 lines
629 B
Arduino
Raw Normal View History

2022-09-08 15:42:03 +02:00
#include <SPI.h>
#include <LoRa.h>
void setup() {
Serial.begin(9600);
while (!Serial);
2022-09-08 16:08:08 +02:00
Serial.println("Applejack is best pony ! Received by Pauline Srifi ~");
2022-09-08 15:42:03 +02:00
2022-09-08 16:08:08 +02:00
if (!LoRa.begin(864E6)) {
2022-09-08 15:42:03 +02:00
Serial.println("Starting LoRa failed!");
while (1);
}
}
void loop() {
// try to parse packet
int packetSize = LoRa.parsePacket();
if (packetSize) {
// received a packet
Serial.print("Received packet '");
// read packet
while (LoRa.available()) {
Serial.print((char)LoRa.read());
}
// print RSSI of packet
Serial.print("' with RSSI ");
Serial.println(LoRa.packetRssi());
}
}