Update RadiLib to V7.1.0
This commit is contained in:
parent
0eead74115
commit
9db7b606a7
219 changed files with 10486 additions and 6297 deletions
|
|
@ -1,12 +1,12 @@
|
|||
/*
|
||||
RadioLib PhysicalLayer Interface Example
|
||||
RadioLib PhysicalLayer Interface Example
|
||||
|
||||
This example shows how to use the common PhysicalLayer
|
||||
to interface with different radio modules using the same
|
||||
methods.
|
||||
This example shows how to use the common PhysicalLayer
|
||||
to interface with different radio modules using the same
|
||||
methods.
|
||||
|
||||
For full API reference, see the GitHub Pages
|
||||
https://jgromes.github.io/RadioLib/
|
||||
For full API reference, see the GitHub Pages
|
||||
https://jgromes.github.io/RadioLib/
|
||||
*/
|
||||
|
||||
// include the library
|
||||
|
|
@ -23,6 +23,14 @@
|
|||
// extra GPIO/interrupt pin: 3 (unused on some modules)
|
||||
RADIO_TYPE radio = new Module(10, 2, 9, 3);
|
||||
|
||||
// or detect the pinout automatically using RadioBoards
|
||||
// https://github.com/radiolib-org/RadioBoards
|
||||
/*
|
||||
#define RADIO_BOARD_AUTO
|
||||
#include <RadioBoards.h>
|
||||
Radio radio = new RadioModule();
|
||||
*/
|
||||
|
||||
// get pointer to the common layer
|
||||
PhysicalLayer* phy = (PhysicalLayer*)&radio;
|
||||
|
||||
|
|
@ -42,7 +50,7 @@ void setup() {
|
|||
} else {
|
||||
Serial.print(F("failed, code "));
|
||||
Serial.println(state);
|
||||
while(true);
|
||||
while (true) { delay(10); }
|
||||
}
|
||||
|
||||
// or we can use the "phy" pointer to access the common layer
|
||||
|
|
@ -54,7 +62,7 @@ void setup() {
|
|||
} else {
|
||||
Serial.print(F("failed, code "));
|
||||
Serial.println(state);
|
||||
while(true);
|
||||
while (true) { delay(10); }
|
||||
}
|
||||
|
||||
// PhysicalLayer also contains basic functionality
|
||||
|
|
@ -66,7 +74,7 @@ void setup() {
|
|||
} else {
|
||||
Serial.print(F("failed, code "));
|
||||
Serial.println(state);
|
||||
while(true);
|
||||
while (true) { delay(10); }
|
||||
}
|
||||
|
||||
// try to receive now - this will almost certainly timeout
|
||||
|
|
@ -82,7 +90,7 @@ void setup() {
|
|||
} else {
|
||||
Serial.print(F("failed, code "));
|
||||
Serial.println(state);
|
||||
while(true);
|
||||
while (true) { delay(10); }
|
||||
}
|
||||
|
||||
// interrupt-driven versions of Rx/Tx are supported as well
|
||||
|
|
@ -105,7 +113,7 @@ void setup() {
|
|||
} else {
|
||||
Serial.print(F("failed, code "));
|
||||
Serial.println(state);
|
||||
while(true);
|
||||
while (true) { delay(10); }
|
||||
}
|
||||
|
||||
// ... or standby
|
||||
|
|
@ -116,7 +124,7 @@ void setup() {
|
|||
} else {
|
||||
Serial.print(F("failed, code "));
|
||||
Serial.println(state);
|
||||
while(true);
|
||||
while (true) { delay(10); }
|
||||
}
|
||||
|
||||
// there are also common SNR/RSSI measurement functions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue