Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Arduino IDE demo source code for KC868-A6]--#11-SX1278-sender_code
#1
Heart 
[Arduino IDE demo source code for KC868-A6]--#11-SX1278-sender_code

Code:
/*SX1278_sender code for KC868-A6*/
#include <LoRa.h>
#include <SPI.h>

#define ss 5
#define rst 21
#define dio0 2

int counter = 0;

void setup()
{
  Serial.begin(115200);
  while (!Serial);
  Serial.println("LoRa Sender");

  LoRa.setPins(ss, rst, dio0);    //setup LoRa transceiver module
 
  while (!LoRa.begin(433E6))     //433E6 - Asia, 866E6 - Europe, 915E6 - North America
  {
    Serial.println(".");
    delay(500);
  }
  LoRa.setSyncWord(0xA5);
  Serial.println("LoRa Initializing OK!");
}

void loop()
{
  Serial.print("Sending packet: ");
  Serial.println(counter);

  LoRa.beginPacket();   //Send LoRa packet to receiver
  LoRa.print("hello ");
  LoRa.print(counter);
  LoRa.endPacket();

  counter++;

  delay(2000);
}
   
.zip   11.sx1278-sender.zip (Size: 945 bytes / Downloads: 312)
.zip   11.sx1278-sender.zip (Size: 945 bytes / Downloads: 312)

   
Reply


Messages In This Thread
[Arduino IDE demo source code for KC868-A6]--#11-SX1278-sender_code - by KinCony Support - 04-26-2022, 01:35 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)