Hi all,
I am trying to make a program to wirelessly send data (joystick) from a nano to an uno using a pair of NRF24L01 chips. But the program I made does not work, and I don't know what the problem is, I am sure it is a problem with my code because other programs using this RF chip are working flawlessly. I looked for hours but I could not find the problem, so I tought it would be a good idea to ask it here.
Here are the programs I am using:
Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.
The examples are as simple as I could make them and they have worked for other Forum members. If you get stuck it will be easier to help with code that I am familiar with. Start by getting the first example to work
Thanks for your answer!
By not working in means it always shows "No data" on the monitor, wich means it does not receive any data from the RF module.
And I placed a delay so it would be asier to read the values on the monitor.
Here's a picture of the 2 serial monitors while the program is running:
RF24_PA_MAX can be problematic if the modules are near to each other.
Ian_99:
And I placed a delay so it would be asier to read the values on the monitor.
That "no data" output is as useful as a doorbell that rings when nobody is there,
printing a message when there was no packet in the last second would make more sense.
Why don't you care what the sending stations radio.write() returncode is?
If you are going to work with a pair of transceivers you need to make things easy for yourself.
This means start from a known working example.
If that doesnt work check that the transmit side is transmitting (this is easy, just monitor
the supply current - it will jump up during a packet transmit). Use a low baud rate for
this testing so the transmit time is reasonably long.
Check antennas are right sort, actually connected, etc.
Check the two units are not too close to each other, separate by several feet. Too close can
fail just as much as too far. Use minimum transmit power setting if both units sat on same bench.
That should get you to a working state, if the hardware is working and the example code isn't bogus.
Then you only ever make one change at a time and re-test before moving on...
Using a source code versioning system is useful, you can then go back easily to working versions, but
really if you made several changes without re-testing, you already made things hard for yourself.