Skip to content

Commit

Permalink
testing examples on qtpy (atsamd21)
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Jun 14, 2021
1 parent 7986d7a commit 795ae09
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 25 deletions.
6 changes: 2 additions & 4 deletions examples/Network_Ping/Network_Ping.ino
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,14 @@ void add_node(uint16_t node);
void setup() {

Serial.begin(115200);
printf_begin();
if (!Serial) {
printf_begin(); // needed for RF24* libs' internal printf() calls
while (!Serial) {
// some boards need this because of native USB capability
}
Serial.println(F("RF24Network/examples/meshping/"));

this_node = node_address_set[NODE_ADDRESS]; // Which node are we?

SPI.begin(); // Bring up the RF network
if (!radio.begin()) {
Serial.println(F("Radio hardware not responding!"));
while (1) {
Expand All @@ -109,7 +108,6 @@ void setup() {
}
radio.setPALevel(RF24_PA_HIGH);
network.begin(/*channel*/ 100, /*node address*/ this_node );

}

void loop() {
Expand Down
5 changes: 2 additions & 3 deletions examples/Network_Ping_Sleep/Network_Ping_Sleep.ino
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,14 @@ unsigned long sleepTimer = 0; // Used to keep track of
void setup() {

Serial.begin(115200);
printf_begin();
if (!Serial) {
printf_begin(); // needed for RF24* libs' internal printf() calls
while (!Serial) {
// some boards need this because of native USB capability
}
Serial.println(F("RF24Network/examples/meshping/"));

this_node = node_address_set[NODE_ADDRESS]; // Which node are we?

SPI.begin(); // Bring up the RF network
if (!radio.begin()) {
Serial.println(F("Radio hardware not responding!"));
while (1) {
Expand Down
7 changes: 2 additions & 5 deletions examples/Network_Priority_RX/Network_Priority_RX.ino
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,8 @@ uint32_t myVariable = 0;
void setup() {

Serial.begin(115200);
if (!Serial) {
// some boards need this because of native USB capability
}
printf_begin(); //Used to enable printf on AVR devices
if (!Serial) {
printf_begin(); // needed for RF24* libs' internal printf() calls
while (!Serial) {
// some boards need this because of native USB capability
}
Serial.println(F("RF24Network/examples/Network_Separation_RX/"));
Expand Down
4 changes: 2 additions & 2 deletions examples/Network_Priority_TX/Network_Priority_TX.ino
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ uint8_t dataBuffer[33];
void setup() {

Serial.begin(115200);
if (!Serial) {
printf_begin(); // needed for RF24* libs' internal printf() calls
while (!Serial) {
// some boards need this because of native USB capability
}
Serial.println(F("RF24Network/examples/Network_Separation_TX/"));
printf_begin(); //Used to enable printf on AVR devices

if (!radio.begin()) {
Serial.println(F("Radio hardware not responding!"));
Expand Down
4 changes: 1 addition & 3 deletions examples/helloworld_rx/helloworld_rx.ino
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ struct payload_t { // Structure of our payload

void setup(void) {
Serial.begin(115200);
if (!Serial) {
while (!Serial) {
// some boards need this because of native USB capability
}
Serial.println(F("RF24Network/examples/helloworld_rx/"));

SPI.begin();
if (!radio.begin()) {
Serial.println(F("Radio hardware not responding!"));
while (1) {
Expand All @@ -64,4 +63,3 @@ void loop(void) {
Serial.println(payload.ms);
}
}

4 changes: 2 additions & 2 deletions examples/helloworld_rx_advanced/helloworld_rx_advanced.ino
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ uint8_t dataBuffer[MAX_PAYLOAD_SIZE]; //MAX_PAYLOAD_SIZE is defined in RF24Netwo
void setup(void) {

Serial.begin(115200);
if (!Serial) {
while (!Serial) {
// some boards need this because of native USB capability
}
Serial.println(F("RF24Network/examples/helloworld_rx_advanced/"));
Expand All @@ -50,7 +50,7 @@ void setup(void) {
}
network.begin(/*channel*/ 90, /*node address*/ this_node);

printf_begin(); // Used to enable printf on AVR devices
printf_begin(); // needed for RF24* libs' internal printf() calls
radio.printDetails(); // requires printf support
}

Expand Down
5 changes: 1 addition & 4 deletions examples/helloworld_tx/helloworld_tx.ino
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,11 @@ struct payload_t { // Structure of our payload

void setup(void) {
Serial.begin(115200);
if (!Serial) {
while (!Serial) {
// some boards need this because of native USB capability
}
Serial.println(F("RF24Network/examples/helloworld_tx/"));

SPI.begin();
if (!radio.begin()) {
Serial.println(F("Radio hardware not responding!"));
while (1) {
Expand Down Expand Up @@ -74,5 +73,3 @@ void loop() {
Serial.println("failed.");
}
}


4 changes: 2 additions & 2 deletions examples/helloworld_tx_advanced/helloworld_tx_advanced.ino
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ uint8_t dataBuffer[MAX_PAYLOAD_SIZE];

void setup(void) {
Serial.begin(115200);
if (!Serial) {
while (!Serial) {
// some boards need this because of native USB capability
}
Serial.println(F("RF24Network/examples/helloworld_tx_advanced/"));
printf_begin(); //Used to enable printf on AVR devices
printf_begin(); // needed for RF24* libs' internal printf() calls

if (!radio.begin()) {
Serial.println(F("Radio hardware not responding!"));
Expand Down

0 comments on commit 795ae09

Please sign in to comment.