loRa.h Problem

Can Anyone help?

The attached sketch, though basic, runs just fine UNTIL I try I try to load the
"Start LoRa duplex TX Sender" in setup.

Everything works just fine except that after loading, Pin 51 remains HIGH.
Even setting Pin 51 LOW in the loop fails to turn off Pin 51.

I need all the Pins from 40 to 52 so I cannot ignore Pin 51 as HIGH.

I have tried another board and redownloaded the loRa.h library.

Without loading LoRa Pin 51 remains LOW as required.

Can anyone suggest anything??

Tx

#include <SPI.h>
#include <LoRa.h>
int aa = 0;
void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);


  for  ( aa = 22;aa<34;aa++){pinMode(aa,OUTPUT);digitalWrite(aa,HIGH);delay(500);digitalWrite(aa,LOW);delay(100);}

   for  ( aa = 42;aa<54;aa++){pinMode(aa,OUTPUT);digitalWrite(aa,HIGH);delay(500);digitalWrite(aa,LOW);delay(100);} 
//...  ????????????????????????????????? START LORA    Problem  Writes Pin 51 HIGH ???????????????????????????????????????????????????????????????
       Serial.println("Start LoRa duplex  TX  Sender");
   if (!LoRa.begin(915E6)) {
   Serial.println("LoRa init failed. Check your connections.");
    while (true) {}
  } 
  } 


void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(31,LOW);
}

Its only a guess, since you seemed to assume we know which Arduino you are using, but could you be using a Mega2560 ?

If so check its pinout diagram and you will spot that pins 50-53 are the SPI interface used by the LoRa device, and you cannot allocate the SPI pins elsewhere.

Thank you SRNET. I am using a Mega and I am sure that was the problem,.

Managed to change the Pin outputs to stay clear of these pins and all works fine.

many thanks.

When odd things happen that does not seem normal, its always worth taking a quick look a the pinout diagrams, this applies to most Arduinos.

And be sure to use logic level conversion for the LoRa device, you can destroy them connecting direct to a 5V Arduino such as the Mega2560.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.