This is an example on how to receive using the RF24_G class
int i = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
uint16_t payload;
Serial.println("packet received!");
Serial.print("count: ");
Serial.println(receiver.
getCnt());
Serial.print("address: ");
Serial.print("payload: ");
Serial.println(payload);
if (test.
write(&receiver) ==
false) {
Serial.println("transmit back failed!");
Serial.println("dropping packet...");
}
}
}
bool read(packet *_packet)
Definition rf24g.cpp:150
bool write(packet *_packet)
Definition rf24g.cpp:122
bool available()
Definition rf24g.cpp:117
uint8_t getAddress() const
Definition rf24g.cpp:24
uint8_t getCnt() const
Definition rf24g.cpp:28
bool readPayload(void *data, const uint8_t size)
Definition rf24g.cpp:48
A simple interface for the RF24 radio that abstracts thmr20's Driver.