I have been using two NRF24L01nRF24L01 to communicate with each other using justa simple Arduino Uno Board. itIt worked for 5 days and now all of a sudden it is now working. I tried to change the modules and the ArduinosArduino boards too , but even if trying a simple example the communication between them is not happening.
I googled everything and tried every option, it is not working.
I used printDetails()printDetails()
to check the config of the modules , it. It shows everything is ok but iI am not be able to understand if the transmitter or the receiver hasis the problem. Please guide me to solve this problem, And also. Also how to make sure if both are working (any debugging technique).?
I amhave been trying it sincefor 9 days now , and iI badly want it to work.
The Code icode I am using is very simple code. it doesntIt doesn't have any errors.
Receiver Code code:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CNS, CE
String response;
boolean done = false;
void setup() {
delay(500);
Serial.begin(9600);
radio.begin();
radio.setPALevel(RF24_PA_MIN);
radio.openReadingPipe(0,0xF0F0F0F0AA);
radio.startListening();
}
void loop() {
if (radio.available()) {
radio.read(&response,
sizeof(response));
done = true;
}
if (done) {
Serial.println(response);
}
done = false;
delay(1000);
}
Sender Codecode:
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CNS, CE
String request;
void setup() {
delay(500);
Serial.begin(9600);
radio.begin();
radio.openWritingPipe(0xF0F0F0F0AA);
radio.setPALevel(RF24_PA_MIN);
radio.stopListening();
}
void loop() {
while ( Serial.available() > 0 ) {
request = Serial.readString();
Serial.println(request);
radio.write(&request, sizeof(request));
delay(1000);
}
}