User Manual

1/16/2018 FireBeetle Covers-LoRa Radio 433MHz SKU:TEL0121 - DFRobot Electronic Product Wiki and Tutorial: Arduino and Robot Wiki-DFRobot.com
https://www.dfrobot.com/wiki/index.php/FireBeetle_Covers-LoRa_Radio_433MHz_SKU:TEL0121 5/6
/*!
* @file sendTest.ino
* @brief DFRobot's send data
* @n [Get the module here]
* @n This example is send.
* @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 counter = 0;
uint8_t sendBuf[] = "HelloWorld!";
/* The default pin:
* SS:D4
* RST:D2 (If you are using the FireBeetle Board-ESP8266 motherboard controller, the RST defaults to D3)
*/
void setup()
{
Serial.begin(115200);
while(!lora.init()) {
Serial.println("Starting LoRa failed!");
delay(100);
}
}
void loop()
{
Serial.print("Sending packet: ");
Serial.println(counter);
// send packet
lora.sendPackage(sendBuf, 11); // sending data
lora.idle(); // turn to standby mode
counter++;
#if 0
if(counter%10 == 0) {
lora.sleep();
delay (5000);// sleep 5 seconds
}
#endif
delay(500);
}
Result
(/wiki/index.php/File:Send.png)
Fig3: The master sends data