Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Libary use #704

Open
RobSoeberg opened this issue Oct 20, 2024 · 0 comments
Open

Libary use #704

RobSoeberg opened this issue Oct 20, 2024 · 0 comments

Comments

@RobSoeberg
Copy link

Hi Guys,
Sorry I am new to this but cannot find how to resolve online. I want to use this libary when not connected to my PC. As soon as I disconnect the Arduino from the PC or dont have the IDE open the <LoRa.h> file does not run. is there a way to have this on the arduino itself so it runs independently? The other issue I cant seem to overcome is on the reciever code, I would like to be able to use the inbound message to light a green led if message is GoGreen and red LED if GoRed. I am using the below code but I cant get it right. Thank you in advance.

void onReceive(int packetSize) {
if (packetSize == 0) return; // if there's no packet, return

// read packet header bytes:
String incoming = "";

while (LoRa.available()) {

incoming += (char)LoRa.read();

}

Serial.println("RSSI: " + String(LoRa.packetRssi()));
Serial.println("Snr: " + String(LoRa.packetSnr()));
Serial.println(incoming);
if ((Serial.println(incoming)) == (GoGreen));
digitalWrite(Green, HIGH);
digitalWrite(Red, LOW);
if ((Serial.println(incoming)) == (GoRed));
digitalWrite(Green, LOW);
digitalWrite(Red, HIGH);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant