I'm trying to get 2 Arduino UNOs to communicate using the nRF24L01+ module. I only need one way communication for now. Ultimately one sender and multiple receivers all getting the same data. At the moment just 1 sender and 1 receiver though. I'm using the base modules that include the 3.3V regulator on them also.
The current issue is on the sender unit the code hangs on the .write operation. It never completes or times out. Just sits at the .write indefinitely. Tried multiple radio modules and checked wiring multiple times as well. What is puzzling is my understanding is the .write operation should at least timeout at some point.
Open to any advice.
This is the code:
#include <Arduino.h>
#include <SPI.h>
#include <RF24.h>
RF24 radio(7,8);
byte addresses[][6] = {"1Node","2Node"};
int dataTransmitted=1;
void setup() {
Serial.begin(115200);
Serial.println("Entering Setup");
radio.begin();
radio.setChannel(108);
radio.setPALevel(RF24_PA_LOW);
radio.setDataRate(RF24_250KBPS);
radio.openWritingPipe(addresses[0]);
radio.openReadingPipe(1,addresses[1]);
delay(1000);
}
void loop() {
Serial.println("Starting write");
radio.write(&dataTransmitted,sizeof(dataTransmitted));
Serial.println("data transmitted: " + String(dataTransmitted));
dataTransmitted++;
delay(3000);
}