Last active
January 21, 2018 13:06
-
-
Save maximeborges/982f78c7d4a8998e5d82f681cbfacd3b to your computer and use it in GitHub Desktop.
Dragino v1.3 RFM98W Sender
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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