I've tested the code a few more times and it seems to be working slightly. I've seen a few more "Hello World" messages appear on my receiver serial monitor, although they were few and far between. From what I can tell, the modules can only communicate (for a very brief moment) immediately after I disconnect the battery from the transmitter.
I haven't made any major changes to the code; instead, I only changed the baud rate and removed a few unnecessary lines before testing.
Transmitter code:
#include <printf.h>
#include <RF24.h>
RF24 radio(9, 10);
const byte address[6] = "00001";
void setup() {
Serial.begin(115200);
printf_begin();
radio.begin();
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();
radio.printDetails();
}
void loop() {
const char text[] = "Hello World";
radio.write(&text, sizeof(text));
}
Receiver code:
#include <printf.h>
#include <RF24.h>
RF24 radio(49, 53);
const byte address[6] = "00001";
void setup() {
Serial.begin(115200);
printf_begin();
radio.begin();
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();
radio.printDetails();
}
void loop() {
if (radio.available()) {
char text[32] = "";
radio.read(&text, sizeof(text));
Serial.println(text);
}
}