I was doing a communication project which failed. So I thought I'll use a detection code to check if my nrf modules are being detected. i tried all possible methods i got from different forums and helpful websites.
```cpp
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CE = 7, CSN = 8 (Change if using different pins)
void setup() {
Serial.begin(115200);
Serial.println("Checking for NRF24L01 module...");
if (!radio.begin()) {
Serial.println("NRF24L01 NOT DETECTED!");
} else {
Serial.println("NRF24L01 Detected Successfully!");
}
}
void loop() {
}
Please post your full sketch, using code tags when you do
Posting your code using code tags prevents parts of it being interpreted as HTML coding and makes it easier to copy for examination
In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.
It is also helpful to post error messages in code tags as it makes it easier to scroll through them and copy them for examination
I see a fuzzy picture that shows a lot of wires but I cannot follow them. Post an annotated schematic showing exactly how you have wired this. I see several potential hardware problems which you will find as you do the schematic.
Incase you are wondering how the battery is conected to one of the circuit:
(+) of T-Plug female connector is connected to Vin on the Arduino Uno.
(-) of T-Plug female connector is connected to GND pin of the Arduino Uno through the bread board.
Hello friend, I went through the link you provided.
According to them they used an nrf24l01 adapter along with their nrf24l01 module which has an ams1117 voltage regulator in it, and I dont have such an adapter but I do have the voltage regulator needed so should I use it in the circuit or let it be?
Also in the schematic it shows a capacitor which also i have but did not use in the circuit.
What is the rught outcome in this situation?
My Arduino recieved enough powerwith it to power an ledbulb-blinking sample model.
My nrf have started detecting after I connected the wires directly to the board. That was one issue but just for readers' further referencing, the antenna near the Arduino cable connecting to the laptop faced issue while the other was fine after solving the first issue then I found the antenna can face disturbances and hence kept moving the antenna to finally recieve a successful detection.
Another doubt, my nrf got detected in both the seriel monitors but now after inputing the project code for text transmission the reciever is not able to recieve the text.
Code for Tx:
Hard to say, but it's clear that you get lots of messages "Text not found" ...
loop() is performed several hundreds or even thousands of times per second (depending on what's done n loop()) but you only get "Hi Recever" once every 2 seconds.
I'd recommend to remove the else clause because you might not see the expected message long enough on display.
Try this code on your controller
void setup() {
Serial.begin(115200);
Serial.println("Start");
}
unsigned long count = 0;
unsigned long last = 0;
void loop() {
count++;
if (millis()-last> 10000){
last = millis();
Serial.println(count);
count = 0;
}
}
and you can see how many loops() are performed in 10 seconds ...