tp0
This commit is contained in:
32
tp0/arduino/LoRaSender/LoRaSender.ino
Normal file
32
tp0/arduino/LoRaSender/LoRaSender.ino
Normal file
@ -0,0 +1,32 @@
|
||||
#include <SPI.h>
|
||||
#include <LoRa.h>
|
||||
|
||||
int counter = 0;
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
while (!Serial);
|
||||
|
||||
Serial.println("Applejack is best pony ! Send by Pauline Srifi ~");
|
||||
|
||||
if (!LoRa.begin(864E6)) {
|
||||
Serial.println("Starting LoRa failed!");
|
||||
while (1);
|
||||
}
|
||||
}
|
||||
|
||||
void loop() {
|
||||
Serial.print("Sending packet: ");
|
||||
Serial.println(counter);
|
||||
|
||||
// send packet
|
||||
LoRa.beginPacket();
|
||||
LoRa.print("Hey Applejack ! How many apple did you sold ?\n I sell ");
|
||||
LoRa.print(counter);
|
||||
LoRa.println("apples");
|
||||
LoRa.endPacket();
|
||||
|
||||
counter++;
|
||||
|
||||
delay(5000);
|
||||
}
|
Reference in New Issue
Block a user