Product Introduction

1/17/2018 FireBeetle Covers-LoRa Radio 915MHz SKU:TEL0122 - DFRobot Electronic Product Wiki and Tutorial: Arduino and Robot Wiki-DFRobot.com
https://www.dfrobot.com/wiki/index.php/FireBeetle_Covers-LoRa_Radio_915MHz_SKU:TEL0122 3/5
(/wiki/index.php/File:Firebeetle_Covers-915MHz-
Connect_CS%26RESET.png)
Fig2: Firebeetle_Covers-915MHz-
Connect_CS&RESET
Software
Arduino IDE Click to Download Arduino IDE from Arduino® (https://www.arduino.cc/en/Main/Software)
Connection
Joint ESP32 board and LoRa module together
Connect ESP32 board to PC via USB line
Sample Code
Click to download FireBeetle Covers-LoRa Radio 915MHz library (https://github.com/DFRobot/DFRobot_Lora) first.
Download the master program and the slave program to two ESP32 board respectively.
The Slave program code
/*!
* @file receiverTest.ino
* @brief DFRobot's received data
* @n [Get the module here]
* @n This example is receive.
* @n [Connection and Diagram]
*
* @copyright [DFRobot](http://www.dfrobot.com), 2016
* @copyright GNU Lesser General Public License
*
* @author [yangyang]
* @version V1.0
* @date 2017-04-10
*/
#include <DFRobot_LoRa.h>
DFRobot_LoRa lora;
uint8_t len;
uint8_t rxBuf[32];
void setup()
{
Serial.begin(115200);
pinMode(LED_BUILTIN, OUTPUT);
Serial.println("Receiver Test");
while(!lora.init()) {
Serial.println("Starting LoRa failed!");
delay(100);
}
lora.rxInit();
}
void loop()
{
if(lora.waitIrq()) { // wait for RXDONE interrupt
lora.clearIRQFlags();
len = lora.receivePackage(rxBuf); // receive data
Serial.write(rxBuf, len);
Serial.println();
lora.rxInit(); // wait for packet from master
// print RSSI of packet
Serial.print("with RSSI ");
Serial.println(lora.readRSSI());
static uint8_t i;
i = ~i;
digitalWrite(LED_BUILTIN, i);
}
}
The Master program code