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
@@ -6,7 +6,10 @@
distance between the modules using time-of-flight
measurement.
Only SX1280 and SX1282 support ranging!
Only SX1280 and SX1282 without external RF switch support ranging!
Note that to get accurate ranging results, calibration is needed!
The process is described in Semtech SX1280 Application Note AN1200.29
For default module settings, see the wiki page
https://github.com/jgromes/RadioLib/wiki/Default-configuration#sx128x---lora-modem
@@ -40,7 +43,7 @@ void setup() {
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
while (true) { delay(10); }
}
}
@@ -57,12 +60,24 @@ void loop() {
int state = radio.range(false, 0x12345678);
*/
// if ranging calibration is known, it can be provided
// this should improve the accuracy and precision
/*
uint16_t calibration[3][6] = {
{ 10299, 10271, 10244, 10242, 10230, 10246 },
{ 11486, 11474, 11453, 11426, 11417, 11401 },
{ 13308, 13493, 13528, 13515, 13430, 13376 }
};
int state = radio.range(true, 0x12345678, calibration);
*/
if (state == RADIOLIB_ERR_NONE) {
// ranging finished successfully
Serial.println(F("success!"));
Serial.print(F("[SX1280] Distance:\t\t\t"));
Serial.print(radio.getRangingResult());
Serial.println(F(" meters"));
Serial.println(F(" meters (raw)"));
} else if (state == RADIOLIB_ERR_RANGING_TIMEOUT) {
// timed out waiting for ranging packet