Update RadioLib

This commit is contained in:
lewisxhe
2024-09-19 11:12:36 +08:00
parent 210367a171
commit 5794daa8aa
301 changed files with 115546 additions and 12703 deletions
@@ -81,7 +81,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// set hop period in symbols
@@ -92,14 +92,14 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
// set the function to call when reception is finished
radio.setDio0Action(setRxFlag);
radio.setDio0Action(setRxFlag, RISING);
// set the function to call when we need to hcange frequency
radio.setDio1Action(setFHSSFlag);
// set the function to call when we need to change frequency
radio.setDio1Action(setFHSSFlag, RISING);
// start listening for LoRa packets
Serial.print(F("[SX1278] Starting to listen ... "));
@@ -109,7 +109,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
}
@@ -123,7 +123,8 @@ void loop() {
// you can also read received data as byte array
/*
byte byteArr[8];
int state = radio.readData(byteArr, 8);
int numBytes = radio.getPacketLength();
int state = radio.readData(byteArr, numBytes);
*/
if (state == RADIOLIB_ERR_NONE) {