Thank you for the reply an guidance, I'll read the "how to post code section".
Yes, I can turn the power down to that power, BUT the problem is that there are many obstacles in the way, so even 800mW will not make it work.
And yes forgetting about the display, the answer is "YES" you can see the RPM and Battery voltage data on the Serial Monitor, BUT NOT on the I2C display.
You can see on the I2C display the reply strings from tranceiver "B" like "Received Message" (on the code), but when it comes to numbers, they show as ZERO.
RPM: 0
Battery Voltage: 0.00V
Any thought?
///LORA TRANSCEIVER "A"///
/////NOTE: BOTH LoRA TRANSCEIVERS SET TO TRANSPARENT MODE /////
#include <SoftwareSerial.h>
#include <Wire.h>
#include <SPI.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,20,4); // I2C 4X20 DISPLAY
const int Request_Feedback_SW = 7; // PIN #D7 OF NANO SET AS A TOGGLE SWITCH
boolean sw4g =true; // Request_Feedback gate
String Request_Feedback_ON = "FeedON";
String Request_Feedback_OFF = "FeedOFF";
int R;
float V;
SoftwareSerial loraSerial(2, 3); // LORA TX, RX TO AVOID INTERFERING WITH FTDI/USB COMM LINES
void setup() {
pinMode (Request_Feedback_SW, INPUT_PULLUP);
Serial.begin(9600);
loraSerial.begin(9600);
lcd.backlight();
}
void loop() {
//IF Request_Feedback is ON
if (sw4g){ // Request_Feedback_ON gate
if ( digitalRead(Request_Feedback_SW)==LOW){
Serial.print("Feedback Switch: ");
Serial.println("ON");
loraSerial.print(Request_Feedback_ON);
Serial.println("Request Feedback ON");
/// LCD "REQUEST DATA" ON///
lcd.init();
lcd.setCursor(0,0);
lcd.print("SENT COMMAND:");
lcd.setCursor(0,1);
lcd.print("REQ.PARAMETERS ON");
sw4g = false;
}
}
//IF Request_Feedback is OFF//
if(!sw4g){ //Same as " if(sw4g = false)"
if (digitalRead (Request_Feedback_SW) == HIGH){
Serial.print("Feedback Switch: ");
Serial.println("OFF");
loraSerial.print(Request_Feedback_OFF);
Serial.println("Request Feedback OFF");
/// LCD "REQUEST PARAMETERS" OFF ////////
lcd.init();
lcd.setCursor(0,0);
lcd.print("SENT COMMAND:");
lcd.setCursor(0,1);
lcd.print("REQ.PARAMETERS OFF");
sw4g = true;
}
}
//////// REQUEST PARAMETERS "ON"//////////////
if(loraSerial.available() > 0){
String input = loraSerial.readString();
Serial.println(input);
if (input == "feedbackON" ) {
R;
V;
lcd.init();
lcd.setCursor(0,0);
lcd.print("RECEIVED COMMAND:");
lcd.setCursor(0,1);
lcd.print("REQ. PARAMETERS ON");
lcd.setCursor(0,2);
lcd.print("RPM:");
lcd.println(R);
lcd.setCursor(5,2);
lcd.print(" ");
lcd.setCursor(0,3);
lcd.print("BATTERY VOLT:");
lcd.println(V);
lcd.setCursor(17,3);
lcd.print("V");
lcd.setCursor(18,3);
lcd.print(" ");
lcd.setCursor(19,3);
lcd.print(" ");
}
//////// REQUEST PARAMETERS "OFF"/////////
if (input == "feedbackOFF"){
lcd.init();
lcd.setCursor(0,0);
lcd.print("RECEIVED COMMAND:");
lcd.setCursor(0,1);
lcd.print("REQ.PARAMETERS OFF");
}
}
delay(100);
}
***********************************************************************************
///LORA TRANSCEIVER "B"///
/////NOTE: BOTH LoRA TRANSCEIVERS SET TO TRANSPARENT MODE /////
#include <SoftwareSerial.h>
const int RPM_Input = 8; // PIN #D8 OF MINI-PRO SET AS RPM INPUT
const int BATT_VOLT = A0; //PIN A0 OF MINI-PRO SET AS BATTERY VOLTAGE INPUT
const int M0 = 13; // LORA M0 PIN SET TO LOW FOR TRANSPARENT DATA MODE
const int M1 = 12; // LORA M1 PIN SET TO LOW FOR TRANSPARENT DATA MODE
int FEEDBACK_ST = LOW;
int RPM_READ;
float V_BATT;
int R;
float V;
String FeedON;
String FeedOFF;
SoftwareSerial loraSerial(2, 3); // TX, RX LORA TX, RX TO AVOID INTERFERING WITH FTDI/USB COMM LINES
void setup() {
//Set M0 and M1 as OUTPUTS from Arduino///
pinMode (M0, OUTPUT);
pinMode (M1, OUTPUT);
//Set M0 and M1 to Mode TRANSPARENT MODE (NORMAL MODE)//
digitalWrite (M0, LOW); // LORA RECEIVER SET TO NORMAL MODE(MODE 0)
digitalWrite (M1, LOW); //LORA RECEIVER SET TO NORMAL MODE(MODE 0)
pinMode(RPM_Input, INPUT_PULLUP);
pinMode (BATT_VOLT, INPUT);
Serial.begin(9600);
loraSerial.begin(9600);
}
void loop() {
if(loraSerial.available() > 0){
String input = loraSerial.readString();
Serial.println(input);
///FEEDBACK TURNED ON FROM TRANSCEIVER "A"////
if (input == "FeedON") {
loraSerial.print("feedbackON");
RPM_READ = pulseIn(RPM_Input, LOW); ///READS ENGINE RPM
V_BATT = analogRead(BATT_VOLT); ///READS BATTERY VOLTAGE
R=RPM_READ;
V=(V_BATT*0.00323); // BATTERY VOLTAGE MULTIPLYING FACTOR
delay(500);
Serial.print ("RPM: ");
Serial.println(R);
loraSerial.print("RPM: ");
loraSerial.println(R);
Serial.print ("Battery Voltage: ");
Serial.println(V);
loraSerial.print("Battery Voltage: ");
loraSerial.println(V);
}
///FEEDBACK TURNED OFF/////
if (input == "FeedOFF") {
loraSerial.print("feedbackOFF");
}
}
delay(100);
}