daily pastebin goal
12%
SHARE
TWEET

Untitled

a guest Mar 25th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <SPI.h>
  2. #include <LoRa.h>
  3. int counter = 0;
  4.  
  5. void setup() {
  6.   Serial.begin(9600);
  7.   while (!Serial);
  8.  
  9.   Serial.println("LoRa Sender");
  10.  
  11.   if (!LoRa.begin(915E6)) {
  12.     Serial.println("Starting LoRa failed!");
  13.     while (1);
  14.   }
  15. }
  16.  
  17. void loop() {
  18.   Serial.print("Sending packet: ");
  19.   Serial.println(counter);
  20.  
  21.   // send packet
  22.   LoRa.beginPacket();
  23.   LoRa.print("hello ");
  24.   LoRa.print(counter);
  25.   LoRa.endPacket();
  26.  
  27.   counter++;
  28.  
  29.   delay(5000);
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top