#include <RF24Network.h>
RF52Network network(radio);
const uint16_t this_node = 01;
const uint16_t other_node = 00;
const unsigned long interval = 2000;
unsigned long last_sent;
unsigned long packets_sent;
struct payload_t {
unsigned long ms;
unsigned long counter;
};
void setup(void) {
Serial.begin(115200);
while (!Serial) {
}
Serial.println(F("RF24Network/examples/helloworld_tx/"));
Serial.println(F("Radio hardware not responding!"));
while (1) {
}
}
network.begin( this_node);
}
void loop() {
network.update();
unsigned long now = millis();
if (now - last_sent >= interval) {
last_sent = now;
Serial.print(F("Sending... "));
payload_t payload = { millis(), packets_sent++ };
RF24NetworkHeader header( other_node);
bool ok = network.write(header, &payload, sizeof(payload));
Serial.println(ok ? F("ok.") : F("failed."));
}
}
Driver class for nRF52840 2.4GHz Wireless Transceiver.
void setChannel(uint8_t channel)