Datasheet
Instead of transmitting, it is constantly checking if there's any data packets that have been received. available() will
return true if a packet with the proper encryption has been received. If so, the receiver prints it out.
It also prints out the RSSI which is the receiver signal strength indicator. This number will range from about -15 to -80.
The larger the number (-15 being the highest you'll likely see) the stronger the signal.
If the data contains the text "Hello World" it will also reply to the packet.
Once done it will continue waiting for a new packet
Basic Receiver/Transmitter Demo w/OLED
OK once you have that going you can try this example, RadioHead69_RawDemoTXRX_OLED. We're using the
Feather with an OLED wing but in theory you can run the code without the OLED and connect three buttons to GPIO
#9, 6, and 5 on the Feathers. Upload the same code to each Feather. When you press buttons on one Feather they will
be printed out on the other one, and vice versa. Very handy for testing bi-directional communication!
void loop() {
if (rf69.available()) {
// Should be a message for us now
uint8_t buf[RH_RF69_MAX_MESSAGE_LEN];
uint8_t len = sizeof(buf);
if (rf69.recv(buf, &len)) {
if (!len) return;
buf[len] = 0;
Serial.print("Received [");
Serial.print(len);
Serial.print("]: ");
Serial.println((char*)buf);
Serial.print("RSSI: ");
Serial.println(rf69.lastRssi(), DEC);
if (strstr((char *)buf, "Hello World")) {
// Send a reply!
uint8_t data[] = "And hello back to you";
rf69.send(data, sizeof(data));
rf69.waitPacketSent();
Serial.println("Sent a reply");
Blink(LED, 40, 3); //blink LED 3 times, 40ms between blinks
}
} else {
Serial.println("Receive failed");
}
}
}
© Adafruit Industries
https://learn.adafruit.com/adafruit-rfm69hcw-and-rfm96-rfm95-rfm98-lora-packet-padio-
breakouts
Page 35 of 70