sandeepmistry / arduino-LoRa

An Arduino library for sending and receiving data using LoRa radios.
MIT License
1.64k stars 627 forks source link

Arduino MKR WAN 1300 Communication Issue #294

Open Tomunsw opened 4 years ago

Tomunsw commented 4 years ago

Hi guys, I'm a noob in this arduino code design. I tried the code in LoRaSend and LoRaReceive and it's successful. So I just adjust the code a bit to make it transmit the data collected from the voltage sensor. I hope it's fine but the board seems to have some problems for now.

  1. I can still upload the code to my MKR board but after I upload the MKRWANFWUpdate_Standalone to my board and open the serial monitor, I can only see one sentense "Press a key to start FW update". Has my board been burned now?
  2. Is there some problem with my codes? I'm not sure whether my board gets trouble because of my poor codes. I will try to insert my code after. `#include

    include

define CollectPeriod 20

int sensorPin=A0; unsigned int sensorValue[CollectPeriod]; unsigned int i = 0;

void setup() {

//initialize Serial Monitor Serial.begin(115200); Serial.println("LoRa Sender");

while (!LoRa.begin(915E6)) { Serial.println("."); delay(500); }

// ranges from 0-0xFF LoRa.setSyncWord(0xF3); Serial.println("LoRa Initializing OK!"); }

void loop() {

for(i=0;i<CollectPeriod;i++) { sensorValue[i] = analogRead(sensorPin); Serial.print("Sending packet number: "); Serial.println(i);

//Send LoRa packet to receiver LoRa.beginPacket(); LoRa.print("Receive packet number:"); LoRa.println(i); LoRa.print("Current value="); LoRa.println(sensorValue[i]);

LoRa.endPacket(); delay(1000); } }` Sorry for my poor english