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

34 lines
522 B
C++

#include <SPI.h>
#include <LoRa.h>
int counter = 0;
char mes[] = "message :";
void setup() {
SerialUSB.begin(9600);
while (!Serial);
SerialUSB.println("LoRa Sender");
if (!LoRa.begin(868E6)) {
SerialUSB.println("Starting LoRa failed!");
while (1);
}
}
void loop() {
SerialUSB.print("paquet envoyé : ");
SerialUSB.println(counter);
// send packet
LoRa.beginPacket();
LoRa.print("message : ");
LoRa.print(counter);
LoRa.print("\n");
LoRa.endPacket();
counter++;
delay(5000);
}