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.
34 lines
507 B
Arduino
34 lines
507 B
Arduino
7 years ago
|
#include <SPI.h>
|
||
|
#include <LoRa.h>
|
||
|
|
||
|
int counter = 0;
|
||
|
char mes[] = "message :";
|
||
|
|
||
|
void setup() {
|
||
|
Serial.begin(9600);
|
||
|
while (!Serial);
|
||
|
|
||
|
Serial.println("LoRa Sender");
|
||
|
|
||
|
if (!LoRa.begin(915E6)) {
|
||
|
Serial.println("Starting LoRa failed!");
|
||
|
while (1);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void loop() {
|
||
|
Serial.print("paquet envoyé : ");
|
||
|
Serial.println(counter);
|
||
|
|
||
|
// send packet
|
||
|
LoRa.beginPacket();
|
||
|
LoRa.print("message : ");
|
||
|
LoRa.print(counter);
|
||
|
LoRa.print("\n");
|
||
|
LoRa.endPacket();
|
||
|
|
||
|
counter++;
|
||
|
|
||
|
delay(1000);
|
||
|
}
|