33 lines
568 B
Arduino
Raw Normal View History

2022-09-08 15:42:03 +02:00
#include <SPI.h>
#include <LoRa.h>
int counter = 0;
void setup() {
Serial.begin(9600);
while (!Serial);
2022-09-08 16:08:08 +02:00
Serial.println("Applejack is best pony ! Send 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() {
Serial.print("Sending packet: ");
Serial.println(counter);
// send packet
LoRa.beginPacket();
2022-09-08 16:08:08 +02:00
LoRa.print("Hey Applejack ! How many apple did you sold ?\n I sell ");
2022-09-08 15:42:03 +02:00
LoRa.print(counter);
2022-09-08 16:08:08 +02:00
LoRa.println("apples");
2022-09-08 15:42:03 +02:00
LoRa.endPacket();
counter++;
delay(5000);
}