From 5b8a9bf902f4dd7a9a496a65be777a4e8c83b80b Mon Sep 17 00:00:00 2001 From: 2bndy5 <2bndy5@gmail.com> Date: Tue, 10 Aug 2021 20:35:07 -0700 Subject: [PATCH] examples don't use deprecated begin(channel, addr) --- examples/Network_Ping/Network_Ping.ino | 3 ++- examples/Network_Ping_Sleep/Network_Ping_Sleep.ino | 3 ++- examples/Network_Priority_RX/Network_Priority_RX.ino | 3 ++- examples/Network_Priority_TX/Network_Priority_TX.ino | 3 ++- examples/helloworld_rx/helloworld_rx.ino | 3 ++- examples/helloworld_rx_advanced/helloworld_rx_advanced.ino | 3 ++- examples/helloworld_tx/helloworld_tx.ino | 3 ++- examples/helloworld_tx_advanced/helloworld_tx_advanced.ino | 3 ++- examples_RPi/helloworld_rx.cpp | 3 ++- examples_RPi/helloworld_tx.cpp | 3 ++- examples_RPi/rx-test.cpp | 3 ++- 11 files changed, 22 insertions(+), 11 deletions(-) diff --git a/examples/Network_Ping/Network_Ping.ino b/examples/Network_Ping/Network_Ping.ino index 7c8ce069..0cdbff74 100644 --- a/examples/Network_Ping/Network_Ping.ino +++ b/examples/Network_Ping/Network_Ping.ino @@ -107,7 +107,8 @@ void setup() { } } radio.setPALevel(RF24_PA_HIGH); - network.begin(/*channel*/ 100, /*node address*/ this_node ); + radio.setChannel(100); + network.begin(/*node address*/ this_node); } void loop() { diff --git a/examples/Network_Ping_Sleep/Network_Ping_Sleep.ino b/examples/Network_Ping_Sleep/Network_Ping_Sleep.ino index 6eaae12f..43e4ef8a 100644 --- a/examples/Network_Ping_Sleep/Network_Ping_Sleep.ino +++ b/examples/Network_Ping_Sleep/Network_Ping_Sleep.ino @@ -106,7 +106,8 @@ void setup() { } } radio.setPALevel(RF24_PA_HIGH); - network.begin(/*channel*/ 100, /*node address*/ this_node ); + radio.setChannel(100); + network.begin(/*node address*/ this_node); /******************************** This is the configuration for sleep mode ***********************/ network.setup_watchdog(wdt_1s); //The watchdog timer will wake the MCU and radio every second to send a sleep payload, then go back to sleep diff --git a/examples/Network_Priority_RX/Network_Priority_RX.ino b/examples/Network_Priority_RX/Network_Priority_RX.ino index f505748a..f4f50c17 100644 --- a/examples/Network_Priority_RX/Network_Priority_RX.ino +++ b/examples/Network_Priority_RX/Network_Priority_RX.ino @@ -55,7 +55,8 @@ void setup() { // hold in infinite loop } } - network.begin(/*channel*/ 90, /*node address*/ this_node); + radio.setChannel(90); + network.begin(/*node address*/ this_node); radio.printDetails(); }//setup diff --git a/examples/Network_Priority_TX/Network_Priority_TX.ino b/examples/Network_Priority_TX/Network_Priority_TX.ino index 7e2b4b71..887d8160 100644 --- a/examples/Network_Priority_TX/Network_Priority_TX.ino +++ b/examples/Network_Priority_TX/Network_Priority_TX.ino @@ -55,7 +55,8 @@ void setup() { // hold in infinite loop } } - network.begin(/*channel*/ 90, /*node address*/ this_node); + radio.setChannel(90); + network.begin(/*node address*/ this_node); radio.printDetails(); // Load our data buffer with numbered data diff --git a/examples/helloworld_rx/helloworld_rx.ino b/examples/helloworld_rx/helloworld_rx.ino index d45d4dc9..ca6998db 100644 --- a/examples/helloworld_rx/helloworld_rx.ino +++ b/examples/helloworld_rx/helloworld_rx.ino @@ -45,7 +45,8 @@ void setup(void) { // hold in infinite loop } } - network.begin(/*channel*/ 90, /*node address*/ this_node); + radio.setChannel(90); + network.begin(/*node address*/ this_node); } void loop(void) { diff --git a/examples/helloworld_rx_advanced/helloworld_rx_advanced.ino b/examples/helloworld_rx_advanced/helloworld_rx_advanced.ino index 3464b3f3..f7dd0b42 100644 --- a/examples/helloworld_rx_advanced/helloworld_rx_advanced.ino +++ b/examples/helloworld_rx_advanced/helloworld_rx_advanced.ino @@ -48,7 +48,8 @@ void setup(void) { // hold in infinite loop } } - network.begin(/*channel*/ 90, /*node address*/ this_node); + radio.setChannel(90); + network.begin(/*node address*/ this_node); printf_begin(); // needed for RF24* libs' internal printf() calls radio.printDetails(); // requires printf support diff --git a/examples/helloworld_tx/helloworld_tx.ino b/examples/helloworld_tx/helloworld_tx.ino index c8409973..82bdb2ea 100644 --- a/examples/helloworld_tx/helloworld_tx.ino +++ b/examples/helloworld_tx/helloworld_tx.ino @@ -50,7 +50,8 @@ void setup(void) { // hold in infinite loop } } - network.begin(/*channel*/ 90, /*node address*/ this_node); + radio.setChannel(90); + network.begin(/*node address*/ this_node); } void loop() { diff --git a/examples/helloworld_tx_advanced/helloworld_tx_advanced.ino b/examples/helloworld_tx_advanced/helloworld_tx_advanced.ino index 9001b5c0..cb78ee10 100644 --- a/examples/helloworld_tx_advanced/helloworld_tx_advanced.ino +++ b/examples/helloworld_tx_advanced/helloworld_tx_advanced.ino @@ -52,7 +52,8 @@ void setup(void) { // hold in infinite loop } } - network.begin(/*channel*/ 90, /*node address*/ this_node); + radio.setChannel(90); + network.begin(/*node address*/ this_node); radio.printDetails(); // Load our data buffer with numbered data diff --git a/examples_RPi/helloworld_rx.cpp b/examples_RPi/helloworld_rx.cpp index e9d7b18d..71b1021d 100644 --- a/examples_RPi/helloworld_rx.cpp +++ b/examples_RPi/helloworld_rx.cpp @@ -43,7 +43,8 @@ int main(int argc, char **argv) } delay(5); - network.begin(/*channel*/ 90, /*node address*/ this_node); + radio.setChannel(90); + network.begin(/*node address*/ this_node); radio.printDetails(); while (1) { diff --git a/examples_RPi/helloworld_tx.cpp b/examples_RPi/helloworld_tx.cpp index 074f020a..b4d4ec6e 100644 --- a/examples_RPi/helloworld_tx.cpp +++ b/examples_RPi/helloworld_tx.cpp @@ -50,7 +50,8 @@ int main(int argc, char **argv) } delay(5); - network.begin(/*channel*/ 90, /*node address*/ this_node); + radio.setChannel(90); + network.begin(/*node address*/ this_node); radio.printDetails(); while (1) { diff --git a/examples_RPi/rx-test.cpp b/examples_RPi/rx-test.cpp index 54867d8b..d6695e81 100644 --- a/examples_RPi/rx-test.cpp +++ b/examples_RPi/rx-test.cpp @@ -57,7 +57,8 @@ int main(int argc, char **argv) radio.setRetries(7, 7); delay(5); - network.begin(/*channel*/ 100, /*node address*/ this_node); + radio.setChannel(100); + network.begin(/*node address*/ this_node); radio.printDetails(); while (1) {