|
|
@ -11,15 +11,20 @@ uint16_t incrTS=0x0000;
|
|
|
|
void setup() {
|
|
|
|
void setup() {
|
|
|
|
SerialUSB.begin(9600);
|
|
|
|
SerialUSB.begin(9600);
|
|
|
|
SerialUSB.println("LoRa Sender");
|
|
|
|
SerialUSB.println("LoRa Sender");
|
|
|
|
|
|
|
|
|
|
|
|
thisLoRa.begin();
|
|
|
|
thisLoRa.begin();
|
|
|
|
protocol.codeFrame(0x0B,0x00,0x0000,0x0001,0x0000,0x0000,0x0000);
|
|
|
|
protocol.codeFrame(0x0B,0x00,0x0000,0x00FF,0x5BA2,0x0D4C,0x9299); // Name : LORA-TEST1 or 0x929A for *2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LoRa.beginPacket();
|
|
|
|
|
|
|
|
LoRa.write((uint8_t*)&protocol, 12); // Send name
|
|
|
|
|
|
|
|
LoRa.endPacket();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void loop()
|
|
|
|
void loop()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
protocol.setDataOne((uint16_t)(random(500, 750)));
|
|
|
|
protocol.setDataOne((uint16_t)(random(500, 750)));
|
|
|
|
protocol.setDataTwo((uint16_t)(random(40, 60)));
|
|
|
|
protocol.setDataTwo((uint16_t)(random(40, 60)));
|
|
|
|
protocol.setDataThree((uint16_t)(random(0, 1)));
|
|
|
|
protocol.setDataThree((uint16_t)(random(0, 2)));
|
|
|
|
incrTS = protocol.getTimestampMessage()+1;
|
|
|
|
incrTS = protocol.getTimestampMessage()+1;
|
|
|
|
protocol.setTimestampMessage(incrTS);
|
|
|
|
protocol.setTimestampMessage(incrTS);
|
|
|
|
|
|
|
|
|
|
|
|