Hello, recently I started a project in which I want to make 2 Arduinos communicate using nRF module and LCD. I hooked everything but I am bad at coding and I tried one but can't seem to make the receiving arduino display the message on the LCD. I am posting the code on both the transmitting and the receiving arduino. I am using a button on the transmitting end and I try to read the button state through text in which it sends. I haven't though of this code I used different codes I found online and snitched them together.
Screenshots of code are nearly worthless. We cannot copy the code to a text editor or to the IDE for examination or verification. Read the forum guidelines to see how to properly post code and some good information on making a good post. If I can copy the code I can try it out on hardware.
I suggest that you use the example code in Robin2's excellent simple rf24 tutorial to get the radios to work. Pay close attention to the part about getting sufficient current to the 3.3V power input.
Some other tips that I have come across.
Run the CheckConnection.ino (look in reply #30 in the tutorial) to verify the physical wiring between the radio module and its processor (Arduino). This is especially useful if all you see is “Data received” repeating much more quickly then there is a problem - most likely theArduino is not communicating properly with its nRF24.
Make sure the rf24 power supply can provide enough current. This is especially true for the high power (external antenna) modules. I use homemade adapters like these. They are powered by 5V and have a 3.3V regulator on the board. Robin2 also has suggested trying with a 2 AA cell battery pack.
If using the high powered radios make sure to separate them by a few meters. They may not work too close together. Try the lower power settings.
Reset the radios by cycling power to them after uploading new code. I have found that to help. They do not reset with the Arduino.
Sending too often can also cause a problem. Trying to send every time through a fast loop may not work. Slow down to 1 to 5 packets per second to test.
Please post a schematic. Hand drawn, photographed and posted is fine. Include all pin names/numbers, components, their part numbers and/or values and power supplies.
Sorry for the code. I realized that doesn't help one bit if I post it that way. The code should be updated already. I will be posting the schematics bellow the code. I am bad at designing schematics so it could be somewhat messy. Thanks for showing me how to post it properly.
As for the sending signals when I try to run the codes on both devices in the serial monitor on the receiver I get that I receive 00 and when i press the button I get B1. I don't know if that is of any help but I guess if I can make different signal when I press it I should be able to read it in a way that can make the LCD show a message. I am not really sure I am still new in these things so any help is appreciated.
I tried your send and receive codes on 2 Unos with rf24 radio modules. I had to change the rf24 CE and CSN pins since my setups are hard wired. And the LCD RS and EN pins had to move from the SPI pins. And I made a small change to the LCD code so the display would not be spammed with "hello world". The code works fine, receiver serial monitor shows "00" for no button press and "B1" when the button is pressed and the LCD is blank for no press and "hello world" with the button press.
One big difference in our setups is that my radio modules are powered by their own 3.3V supply using a LM1117 3.3 connected to the Uno 5V rail (home made, but similar to these adapters). The most common problem causing those radios to not work is lack of current to the radio.
So the code is OK. That suggests a hardware problem. Either power or wiring. Robin2's tutorial has some suggestions about how to supply sufficient power and a diagnostic sketch to verify the wiring between the radio module and its host processor (see post #30 of the tutorial linked in post #2).
I found my problem. My problem was that my nRF and LCD were on the same SPI pins. I moved the LCD 10 and 9 and works like a charm. I updated the code a bit as well so to not spam "hello world" non stop when I hold the button with delay and clear after each tick.
Now I want to make it bidirectional with LCD on each side. Thanks a lot for the help and if I need any help with the bidirectional I will post again.