1
0
mirror of https://github.com/sandeepmistry/arduino-LoRa.git synced 2025-08-06 07:02:40 +03:00

Add initial sender and receiver examples

This commit is contained in:
Sandeep Mistry
2016-08-20 09:12:25 -04:00
parent 038378c139
commit fd94031ea8
2 changed files with 63 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
#include <SPI.h>
#include <LoRa.h>
int counter = 0;
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("Sending packet: ");
Serial.println(counter);
// send packet
LoRa.beginPacket();
LoRa.print("hello ");
LoRa.print(counter);
LoRa.endPacket();
counter++;
delay(5000);
}