I’m trying to use Bluetooth and Lora on the V2 device but it seems I can only use 1 at a time. So I added an external Bluetooth HC-06 bluetooth device that connects to Tx & Rx.
With the code including the Bluetooth and Lora sketch, its seems the code stalls. I think its because bluetooth and Lora both use the Tx pin but I’m not sure. Can anyone spot the reason it’s not working?
// Youtube https://www.youtube.com/watch?v=DEAZZ16QB5I
// Code & MIT App Files https://drive.google.com/file/d/1MzA7tuMQzaiciq7S48lZOtvqeHKufh7M/view
#include “heltec.h”
#define BAND 915E6
#define LED 25
char Incoming_value=0;
int counter = 0;
void setup() {
Serial.begin(9600);
pinMode(25,OUTPUT);
Heltec.begin(false /DisplayEnable Enable/, true /Heltec.LoRa Disable/, true /Serial Enable/, true /PABOOST Enable/, BAND /long BAND/);
}
void loop() {
if(Serial.available()>0){
Serial.println(“Receiving_Value”);
Incoming_value=Serial.read();
Serial.println(Incoming_value);
Serial.print("\n");
if(Incoming_value=='0'){
digitalWrite(LED,LOW);
LoRa.setTxPower(14,RF_PACONFIG_PASELECT_PABOOST);
LoRa.beginPacket();
LoRa.print("LEDLOW");
LoRa.endPacket();
Serial.print("\n");
}
else if (Incoming_value=='1'){
digitalWrite(LED,HIGH);
Serial.println("ReceivingHigh");
LoRa.setTxPower(14,RF_PACONFIG_PASELECT_PABOOST);
LoRa.beginPacket();
LoRa.print("LEDHIGH");
LoRa.endPacket();
Serial.print("\n");
}
}
}