Skip to content

Instantly share code, notes, and snippets.

@maximeborges
Last active January 21, 2018 13:06
Show Gist options
  • Save maximeborges/982f78c7d4a8998e5d82f681cbfacd3b to your computer and use it in GitHub Desktop.
Save maximeborges/982f78c7d4a8998e5d82f681cbfacd3b to your computer and use it in GitHub Desktop.
Dragino v1.3 RFM98W Sender
// Install the LoRa library by Sandeep Mistry via the Arduino interface (https://github.com/sandeepmistry/arduino-LoRa)
#include <SPI.h>
#include <LoRa.h>
int counter = 0;
void setup() {
Serial.begin(115200);
while (!Serial);
Serial.println("LoRa Sender");
if (!LoRa.begin(433E6)) {
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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment