I only have one USB cable, so I can't connect both Arduino boards to my computer.
Here is my updated transmitter code:
#include <printf.h>
#include <RF24.h>
RF24 radio(9, 10);
const byte address[6] = "00001";
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
printf_begin();
radio.begin();
radio.openWritingPipe(address);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();
radio.printDetails();
}
void loop() {
// put your main code here, to run repeatedly:
const char text[] = "Hello World";
radio.write(&text, sizeof(text));
delay(1000);
}
Meanwhile, here is my updated receiver code:
#include <printf.h>
#include <RF24.h>
RF24 radio(49, 53);
const byte address[6] = "00001";
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
printf_begin();
radio.begin();
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();
radio.printDetails();
}
void loop() {
// put your main code here, to run repeatedly:
if (radio.available()) {
char text[32] = "";
radio.read(&text, sizeof(text));
Serial.println(text);
}
}